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

MCQs (HTML)

Multiple Choice Questions

  1. 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
  2. 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
  3. 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
  4. 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.
  5. 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>
  6. 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
  7. A 'ul' element isn't very useful unless it contains what kind of tags?

    1. il
    2. li
    3. i
    4. e
  8. 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
  9. All headings should be used within the header element.

    1. True
    2. False
  10. Which of the following is a non-semantic tag?

    1. < body >
    2. < img >
    3. < div >
    4. < p >
  11. The primary purpose of HTML is to assist formatting of text.

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

    1. src
    2. title
    3. height
    4. None of the given.
  13. <!-- If this line were in your code, would you see it on your Web page? -->

    1. Yes
    2. No
  14. The anchor element is the same as the < link > tag.

    1. True
    2. False
  15. 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.
  16. <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
  17. The <p> tag is used to denote:

    1. list
    2. paragraph
    3. heading
    4. None of the given.
  18. 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.
  19. What is the difference between Internet and Web?

    1. Web is an application of Internet
    2. Internet and Web are the same thing
  20. 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
  21. Any complete HTML5 file must contain bits of CSS and Javascript.

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

    1. True
    2. False
  23. 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
  24. You can have multiple header and footer elements in your Web page.

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

    1. Yes
    2. No
  26. 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 >
  27. 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
  28. If you want to have the largest heading possible, which kind of tag you would use?

    1. head
    2. h1
    3. h6
    4. h
  29. Which semantic element has content that should be expanded to view?

    1. figcaption
    2. details
    3. expand
    4. summary
  30. You do need a connection to the Internet to test your HTML code.

    1. True
    2. False
  31. 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" >
  32. 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
  33. 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
  34. <span> should be used anytime you want to make inline changes

    1. True
    2. False
  35. Setting the size for an image must always be done using the 'height' and 'width' attributes.

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

    1. Yes
    2. No
  37. What is the last tag in a well-behaved html file?

    1. < /head >
    2. < /html >
    3. < /doctype >
    4. < /body >
  38. < 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=“)
  39. The closing tag for image is .

    1. True
    2. False
  40. What does the 'M' in HTML5 stand for?

    1. more
    2. mark
    3. markup
    4. main
  41. A tooltip in the title attribute can only be used on images.

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

    1. &
    2. /
    3. !
    4. >
  43. 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
  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. 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
  46. HTML tags are case sensitive.

    1. True
    2. False
  47. <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
  48. 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.
  49. You need to use both height and width attributes to shrink your image by half.

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

    1. True
    2. False
  51. 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
  52. 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.
  53. Attributes are used to add extra info to a tag, like a unique identifier.

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

    1. Assistive technology users
    2. The browser
    3. The search engine
    4. The server
  55. Elements are the same as tags.

    1. True
    2. False
  56. 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
  57. 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
  58. HTML tags and HTML elements the same thing. True or false?

    1. True
    2. False
  59. The main reason the Internet was created was to support the World Wide Web

    1. True
    2. False
  60. Semantic elements, like article and section, don't use attributes.

    1. True
    2. False
  61. 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
  62. 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
  63. You can use either ' (single quote) or " (double quote) to denote a string.

    1. True
    2. False
  64. 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
  65. Since HTML5 ignores white space, a tag can be spelled with spaces in it, i.e. "ht ml"

    1. True
    2. False
  66. The HTML structure of a document is a tree. True or false?

    1. True
    2. False
  67. The non-global attribute ‘size’ can only be applied to one tag.

    1. True
    2. False
  68. 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
  69. < 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
  70. Which tag will you use to convey importance in your text?

    1. Emphasis < em >
    2. Strong < strong >
    3. Italics < i >
    4. Bold < b >
  71. 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
  72. Images can be added to your Web page in more than one way.

    1. True
    2. False
  73. Which attribute do you use when you want to provide more information about a complicated image?

    1. alt
    2. info
    3. id
    4. title
  74. 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.
  75. 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.
  76. 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
  77. The 'mailto:' protocol in the href attribute can validate the email address provided.

    1. True
    2. False
  78. <....> 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 >
  79. What is the difference between Internet and Web?

    1. Internet and Web are the same thing
    2. Internet is a network of networks
  80. The anchor element is only used to link from one page to another.

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

    1. href
    2. src
    3. hyperlink
    4. anchor
  82. Which is the required attributes in an image tag?

    1. title
    2. height
    3. alt
    4. None of the given.
  83. 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>
  84. What tag would you use to emphasize some text?

    1. em or strong
    2. emphasize
    3. text
    4. None of the given.