In the name of ALLAH, the most beneficient, the most merciful

MCQs (HTML)

Multiple Choice Questions

  1. You do need a connection to the Internet to test your HTML code.

    1. True
    2. False
  2. Is it valid to have a paragraph element inside the < head > tag?

    1. Yes
    2. No
  3. Setting the size for an image must always be done using the 'height' and 'width' attributes.

    1. True
    2. False
  4. Any complete HTML5 file must contain bits of CSS and Javascript.

    1. True
    2. False
  5. What do you use to split multiple classnames in the 'class' attributes?

    1. You can only specify one classname in the 'class' attribute
    2. space
    3. comma
    4. colon
  6. The 'mailto:' protocol in the href attribute can validate the email address provided.

    1. True
    2. False
  7. < p id="intro">Hi! My name is Alex and I love to cook.< /p >
    Unlike most attributes, the id of an element should be:

    1. split by spaces if you want to specify multiple values
    2. the same across a given type of element i.e. all paragraphs have the same id
    3. unique to that element and can only be used once
    4. written in all caps (“ID=“)
  8. How many elements should your document have?

    1. 42
    2. As many as you need or want to make it clear and organized
    3. Less than 128
    4. As few as possible
  9. What is the difference between Internet and Web?

    1. Web is an application of Internet
    2. Internet and Web are the same thing
  10. One of the functions of the 'alt' attribute is to provide information about the image to assistive technologies and search engines.

    1. True
    2. False
  11. The term hypertext means:

    1. Writing in ALL CAPS
    2. Text with embedded links to other documents
    3. Very energetic words
    4. None of the given.
  12. What’s the best way to ensure that your picture will display correctly?

    1. add the 'src' attribute
    2. add the 'display' attribute
    3. use an image file format commonly supported by browsers
    4. change your HTML editor
  13. What is the difference between Internet and Web?

    1. Internet and Web are the same thing
    2. Internet is a network of networks
  14. Which of the following statements about global attributes is true?

    1. All global attributes are of type boolean
    2. Global attributes are common to all elements
    3. Only 'id' and 'class' are global attributes
    4. Global attributes only apply to elements that do not have any attributes of their own
  15. Which of the following is a non-semantic tag?

    1. < body >
    2. < img >
    3. < div >
    4. < p >
  16. The HTML structure of a document is a tree. True or false?

    1. True
    2. False
  17. What is the first character after a "<" in a closing tag?

    1. &
    2. /
    3. !
    4. >
  18. < a href="https://w3.org" target="_blank" >W3C< /a >
    What does the code above do?

    1. Opens the page in a separate frame
    2. Opens the page in a new tab or window
    3. Doesn't do anything as the code above is invalid
    4. Opens the page in the same tab or window
  19. If your editor saves in a variety of formats, which of the following should you be sure to use for your Web page?

    1. .exe or Executable
    2. .rtf or Rich Text Format
    3. .txt or plain text
    4. .docx or MS Document File
  20. A ul element wouldn't be terribly useful unless it contained one or more of these elements:

    1. em
    2. i
    3. li
    4. heading
  21. HTML tags and HTML elements the same thing. True or false?

    1. True
    2. False
  22. <span> should be used anytime you want to make inline changes

    1. True
    2. False
  23. All browsers support all attributes.

    1. True
    2. False
  24. The anchor element is only used to link from one page to another.

    1. True
    2. False
  25. The extension of the file name is not needed for 'download' attribute's value.

    1. True
    2. False
  26. What is the purpose of the semantic element < mark >?

    1. so it can be refered to by other semantic elements
    2. underline text
    3. strikethrough text
    4. highlight text
  27. The anchor element is the same as the < link > tag.

    1. True
    2. False
  28. Which of the following is a valid value following best practice for the id attribute?

    1. < p id=""> < /p >
    2. < p id="NaViGaTiOn" > < /p >
    3. < p id="score-display" > < /p >
    4. < p id="Frequently asked questions" > < /p >
  29. A 'ul' element isn't very useful unless it contains what kind of tags?

    1. il
    2. li
    3. i
    4. e
  30. <....> You need to leave immediately. Your office is bugged! <....>
    Which of the following tags should be used in this case?

    1. < strong >
    2. < i >
    3. < b >
    4. < em >
  31. You need to use both height and width attributes to shrink your image by half.

    1. True
    2. False
  32. Different documents can be linked together using which one of these elements?

    1. href
    2. src
    3. hyperlink
    4. anchor
  33. Which of the following image paths follow the best practice for a relative URL?

    1. package\assets\Images\example.PNG
    2. images/example.png
    3. Package/Assets/Images/Example.png
    4. images\example.png
  34. Which of the following is not among "Best practices"?

    1. Primarily designed to make your code run faster
    2. Suggested good habits based on experience
    3. Intended to make your code cleaner and more organized
  35. <!-- If this line were in your code, would you see it on your Web page? -->

    1. Yes
    2. No
  36. Which is the required attributes in an image tag?

    1. src
    2. title
    3. height
    4. None of the given.
  37. <ol id="student-male" class="primary" start="10"></ol>
    <ol start="10" class="primary" id="student-male"></ol>


    Both tags will give the same output. The order in which the attributes are specified in the opening tag does not matter.

    1. True
    2. False
  38. Attributes are used to add extra info to a tag, like a unique identifier.

    1. True
    2. False
  39. Which is the required attributes in an image tag?

    1. title
    2. height
    3. alt
    4. None of the given.
  40. Which of these HTML fragments would render differently from the others?

    1. <P>This is my Paragraph</P>
    2. <P>       This is my Paragraph</P>
    3. <P>This is my    Paragraph</P>
    4. <P>This   is   my   Paragraph</P>
  41. Since HTML5 ignores white space, a tag can be spelled with spaces in it, i.e. "ht ml"

    1. True
    2. False
  42. Can some elements contain other elements?

    1. Yes
    2. No
  43. The primary purpose of HTML is to assist formatting of text.

    1. True
    2. False
  44. If you want to indicate that a large passage of text is an exact quotation, what tag would you use?

    1. blockquote
    2. quote
    3. quotation
    4. None of the given.
  45. Suppose you have a small image that looks like a warning sign - ⚠. You want to place it near a particular paragraph on your Web page. Should you use an tag for the warning sign, or should you add it via CSS commands?

    1. Image tag
    2. CSS
  46. Which is the correct nesting of these elements?

    1. "p" inside "body" inside "html"
    2. "html" inside "body" inside "p"
    3. "p" inside "body" inside "head"
    4. None of the given.
  47. Which of the following is not used to create a Web page?

    1. A simple text editor
    2. An advanced HTML aware editor
    3. A Fortran compiler
    4. A gui based tool
  48. Which semantic element has content that should be expanded to view?

    1. figcaption
    2. details
    3. expand
    4. summary
  49. The non-global attribute ‘size’ can only be applied to one tag.

    1. True
    2. False
  50. The <p> tag is used to denote:

    1. list
    2. paragraph
    3. heading
    4. None of the given.
  51. If you have an image you want to add as a background to your Web page, your 'alt' attribute's value should be:

    1. no alt attribute is needed
    2. empty - ""
    3. a background image
    4. a decorative image
  52. If I told you that an open tag looked like this: <div id='mydiv' class='myclass'>, what would the closing tag look like?

    1. </mydiv>
    2. </id>
    3. </div>
    4. None of the given.
  53. What does the 'M' in HTML5 stand for?

    1. more
    2. mark
    3. markup
    4. main
  54. What does character encoding do?

    1. helps translate page from one language to another
    2. acts like a dictionary that helps translate code points into bytes that can be stored in memory.
    3. provides support for search engines to process your HTML documents correctly
    4. None of the given.
  55. <p id="greeting" class="hello world">This is me greeting the world</p>
    Which of the following is the correct behavior with respect to the code above?

    1. Both the classname and paragraph text cannot contain "world"
    2. Two different classes "hello" and "world" will be applied to the paragraph
    3. The code is invalid because space is not allowed in class attribute's value
    4. One class "hello world" will be applied to the paragraph
  56. Images can be added to your Web page in more than one way.

    1. True
    2. False
  57. Elements are the same as tags.

    1. True
    2. False
  58. You can use either ' (single quote) or " (double quote) to denote a string.

    1. True
    2. False
  59. What doctype is used for HTML5 documents?

    1. < !DOCTYPE html >
    2. < !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
    3. < ?xml version="1.0" standalone="yes" ? >
    4. < !DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd" >
  60. What does character encoding do?

    1. provides support for search engines to process your HTML documents correctly
    2. helps translate page from one language to another
    3. decodes bytes into code points
    4. None of the given.
  61. If you want to have the largest heading possible, which kind of tag you would use?

    1. head
    2. h1
    3. h6
    4. h
  62. What will happen if you fail to follow a "best practice"?

    1. The computer will complain
    2. The browser will loudly complain
    3. Experienced developers will complain
    4. The browser will quietly complain
  63. What tag would you use to emphasize some text?

    1. em or strong
    2. emphasize
    3. text
    4. None of the given.
  64. What is the last tag in a well-behaved html file?

    1. < /head >
    2. < /html >
    3. < /doctype >
    4. < /body >
  65. If you have a mistake in your HTML code, the browser will:

    1. Replace your Web page with an error code
    2. Try its best to fix it and continue
    3. Crash and need to be restarted
    4. Highlight that part of the Web page in red
  66. The main reason the Internet was created was to support the World Wide Web

    1. True
    2. False
  67. Who does semantic elements not benefit?

    1. Assistive technology users
    2. The browser
    3. The search engine
    4. The server
  68. You can have multiple header and footer elements in your Web page.

    1. True
    2. False
  69. What is the difference between HTML and HTTP?

    1. HTTP describes what's on the page and HTML allows sites to communicate with each other
    2. HTML describes what's on a page and HTTP allows the page to be communicated to a user
    3. HTML and HTTP are the same thing
    4. None of the given.
  70. What does the 'alt' attribute do?

    1. used to distinguish image and text links by a screen reader
    2. describes the information the image conveys or its function
    3. display information about an ambiguous image as a tooltip
    4. links to a URL
  71. Let's consider a space, or a tab or a carriage return. What are each of them referred to?

    1. white space
    2. text
    3. heading
    4. paragraph
  72. Why should you use semantic elements in your Web page?

    1. It provides meaning and structure to the Web page and improves automated processing of documents
    2. A user will eventually run out of 'id' values and semantic elements solve that problem
    3. It makes styling the Web page easier
    4. It will drastically improve the structure of your document visually
  73. What is the purpose of your download attribute's value in a hyperlink?

    1. It is a boolean value authorizing download
    2. It is the name of file in the location specified in href
    3. Downloaded file name will be modified according to value specified
    4. Download attribute has no value
  74. All headings should be used within the header element.

    1. True
    2. False
  75. You are designing a Web page to store your grandmother's recipes. Each recipe should be enclosed in a section element.

    1. True
    2. False
  76. Which of the following is not among "Best practices"?

    1. Intended to make your code cleaner and more organized
    2. Absolute rules that every html file must obey
    3. Suggested good habits based on experience
  77. Which attribute do you use when you want to provide more information about a complicated image?

    1. alt
    2. info
    3. id
    4. title
  78. A tooltip in the title attribute can only be used on images.

    1. True
    2. False
  79. The closing tag for image is .

    1. True
    2. False
  80. Which tag will you use to convey importance in your text?

    1. Emphasis < em >
    2. Strong < strong >
    3. Italics < i >
    4. Bold < b >
  81. Semantic elements, like article and section, don't use attributes.

    1. True
    2. False
  82. What is the output for the code below?
    &lt;h1&gt;This is a heading &amp; it is the &quot;biggest&quot; one in this page&gt;/h1&lt;

    1. This is a heading & it is the "biggest" one in this page
    2. <h1>This is a heading & it is the "biggest" one in this page>/h1<
    3. &lt;h1&gt;This is a heading &amp; it is the &quot;biggest&quot; one in this page&gt;/h1&lt;
    4. <h1>This is a heading & it is the "biggest" one in this page</h1>
  83. HTML tags are case sensitive.

    1. True
    2. False
  84. What are the little bits of text that surround elements in an html file?

    1. lists
    2. tags
    3. attributes
    4. None of the given.