HTML Basics: Beginner Interview Quiz Quiz

Test your foundational knowledge of HTML with this beginner-level quiz featuring essential HTML concepts, common tags, and basic syntax. Ideal for interview preparation and those new to HTML, this quiz will help you identify strengths and areas for improvement in web development fundamentals.

  1. HTML Full Form

    What does the acronym 'HTML' stand for?

    1. Hyperlink and Text Markup Line
    2. Hyper Tag Marking Language
    3. Home Tool Markup Language
    4. HyperText Markup Language

    Explanation: HTML stands for HyperText Markup Language and is the foundational language to create webpages. 'Home Tool Markup Language' and 'Hyperlink and Text Markup Line' are incorrect phrases that do not represent the standard. 'Hyper Tag Marking Language' is also wrong as it's a made-up term. Only the correct option defines what HTML actually stands for.

  2. Purpose of HTML

    Which of the following best describes what HTML is used for?

    1. Describing the structure of web pages
    2. Running backend code
    3. Managing databases
    4. Styling web pages

    Explanation: HTML is primarily used to describe the structure and layout of web pages using elements and tags. Styling web pages is handled by CSS, not HTML. Running backend code is the task of languages like Python or JavaScript on the server side, and managing databases is unrelated to HTML.

  3. HTML Tag Example

    Which of the following is a correct example of an HTML tag?

    1. [title]
    2. u003Cpu003E
    3. {body}
    4. (div)

    Explanation: HTML tags are denoted using angle brackets, such as u003Cpu003E for a paragraph tag. The options (div), {body}, and [title] use incorrect brackets for HTML and are not recognized as valid tags.

  4. Element vs. Tag

    What is the main difference between an HTML element and an HTML tag?

    1. An element is just the starting bracket of a tag
    2. They mean exactly the same thing in HTML
    3. A tag is used to define an element, while an element includes the tags and content between them
    4. A tag contains all the content and attributes

    Explanation: A tag marks the start or end of an element, but the element itself includes the opening tag, content, and closing tag. The second and fourth options mischaracterize elements and tags. Saying they are exactly the same ignores the distinction in HTML usage.

  5. Basic HTML Structure

    Which of these snippets represents the most basic correct structure of an HTML document?

    1. u003Cbodyu003Eu003Chtmlu003Eu003Cheadu003Eu003C/headu003Eu003C/htmlu003Eu003C/bodyu003E
    2. u003C!DOCTYPE htmlu003Eu003Chtmlu003Eu003Cheadu003Eu003C/headu003Eu003Cbodyu003Eu003C/bodyu003Eu003C/htmlu003E
    3. u003Cdocumentu003Eu003Cheadu003Eu003C/headu003Eu003Cbodyu003Eu003C/bodyu003Eu003C/documentu003E
    4. u003Chtmlu003Eu003Cbodyu003Eu003Cheadu003Eu003C/headu003Eu003C/bodyu003Eu003C/htmlu003E

    Explanation: A proper HTML document starts with u003C!DOCTYPE htmlu003E and contains u003Chtmlu003E, u003Cheadu003E, and u003Cbodyu003E elements in correct order. The other options mix up tag order or use incorrect tags that do not exist in HTML.

  6. Purpose of u003Ctitleu003E Tag

    What is the main function of the u003Ctitleu003E tag in an HTML document?

    1. Shows a large heading on the page
    2. Adds a subtitle to images
    3. Makes the text bold
    4. Displays the title in the browser tab

    Explanation: The u003Ctitleu003E tag content appears in the browser's title bar or tab, making it easy to identify the page. The tag does not affect the text's style on the page, nor does it create headings or subtitles for images.

  7. Correct Paragraph Tag

    Which tag is used to mark a paragraph in HTML?

    1. u003Cparagraphu003E
    2. u003Cparau003E
    3. u003Cpu003E
    4. u003Cppu003E

    Explanation: The correct tag for marking a paragraph is u003Cpu003E. The alternatives are not valid HTML tags; u003Cppu003E, u003Cparau003E, and u003Cparagraphu003E do not exist in the HTML specification.

  8. Closing Tags

    Which of the following elements usually requires a closing tag?

    1. u003Cpu003E
    2. u003Cbru003E
    3. u003Cimgu003E
    4. u003Cmetau003E

    Explanation: u003Cpu003E is a standard container element and requires both opening and closing tags. The elements u003Cbru003E, u003Cimgu003E, and u003Cmetau003E are typically self-closing or void elements and do not require a closing tag.

  9. Header Tags

    Which sequence shows HTML header tags in order from largest to smallest?

    1. u003Cbigu003E, u003Cmediumu003E, u003Csmallu003E, u003Ctinyu003E
    2. u003Ch1u003E, u003Ch2u003E, u003Ch3u003E, u003Ch4u003E, u003Ch5u003E, u003Ch6u003E
    3. u003Ch6u003E, u003Ch5u003E, u003Ch4u003E, u003Ch3u003E, u003Ch2u003E, u003Ch1u003E
    4. u003Cheaderu003E, u003Cheadu003E, u003Ctitleu003E, u003Ch1u003E

    Explanation: HTML header tags u003Ch1u003E to u003Ch6u003E go from largest to smallest heading. Reversing the order is incorrect. u003Cheaderu003E, u003Cheadu003E, and u003Ctitleu003E serve different purposes and are not header size indicators. u003Cbigu003E, u003Cmediumu003E, u003Csmallu003E, u003Ctinyu003E are not valid header tags.

  10. Line Breaks in HTML

    How do you insert a line break in HTML?

    1. u003Cbreaku003E
    2. u003Clinebreaku003E
    3. u003Clbu003E
    4. u003Cbru003E

    Explanation: The u003Cbru003E tag is the standard way to create a line break in HTML. The options u003Cbreaku003E, u003Clbu003E, and u003Clinebreaku003E are not valid HTML tags and won't work for this purpose.

  11. Creating a Link

    What is the correct tag to create a hyperlink in HTML?

    1. u003Chrefu003E
    2. u003Cau003E
    3. u003Clinku003E
    4. u003Curlu003E

    Explanation: The u003Cau003E tag, also called an anchor tag, is used to create hyperlinks in HTML. The u003Clinku003E element serves other uses like including stylesheets, while u003Chrefu003E is an attribute not a tag, and u003Curlu003E is not a valid HTML tag.

  12. Including Images

    Which tag is used to display an image on a web page in HTML?

    1. u003Cpictureu003E
    2. u003Cimageu003E
    3. u003Cphotou003E
    4. u003Cimgu003E

    Explanation: The u003Cimgu003E tag is the correct HTML element for embedding images. u003Cpictureu003E is an advanced element for responsive images, but not the standard for simple image insertion. u003Cphotou003E and u003Cimageu003E are not standard HTML tags.

  13. Lists in HTML

    Which tag is used to create an unordered (bulleted) list in HTML?

    1. u003Cliu003E
    2. u003Colu003E
    3. u003Culu003E
    4. u003Clistu003E

    Explanation: The u003Culu003E tag creates an unordered (bulleted) list. u003Colu003E is for ordered, numbered lists, while u003Cliu003E defines list items inside a list, and u003Clistu003E is not a valid HTML tag.

  14. Adding Comments

    What is the correct way to add a comment in HTML?

    1. // This is a comment
    2. # This is a comment
    3. u003C!-- This is a comment --u003E
    4. ** This is a comment **

    Explanation: The proper syntax for HTML comments involves u003C!-- and --u003E. Using // or # is for comments in programming languages like JavaScript or Python, while ** is not valid for comments in HTML.

  15. Case Sensitivity

    Is HTML case sensitive when it comes to tag names?

    1. Yes, tags must always be uppercase
    2. No, HTML tags are not case sensitive
    3. Yes, tags must always be lowercase
    4. Only self-closing tags are case sensitive

    Explanation: HTML is not case sensitive, so u003CDIVu003E, u003CDivu003E, and u003Cdivu003E are treated the same. Requiring only lowercase or uppercase is not part of the HTML standard, and case sensitivity does not apply only to self-closing tags.