HTML Quiz (Intermediate) - All Questions
This HTML Intermediate Quiz is designed for learners who know HTML basics and want to test their practical and semantic understanding. It focuses on real-world usage, accessibility, and interview-relevant HTML concepts to strengthen frontend fundamentals.
Question 1: What is the main advantage of using semantic HTML elements?
- They reduce page load time
- They provide meaning and structure to content
- They automatically apply styles
- They replace CSS
Explanation: Semantic elements describe the purpose of content, improving accessibility and SEO.
Question 2: Which HTML element should contain the primary content of a webpage?
- <section>
- <article>
- <main>
- <div>
Explanation: <main> represents the dominant content of the document.
Question 3: Which attribute is most important for image accessibility?
Explanation: The alt attribute provides text alternatives for screen readers.
Question 4: Which HTML element is best suited for a standalone blog post?
- <section>
- <article>
- <div>
- <aside>
Explanation: <article> represents independent, reusable content.
Question 5: Which tag is specifically used for navigation links?
Explanation: <nav> defines a section for navigation links.
Question 6: Which input type allows selecting only one option from a group?
- checkbox
- select
- radio
- option
Explanation: Radio buttons allow selecting only one option.
Question 7: Which element conveys semantic importance to search engines?
Explanation: <strong> conveys importance, not just visual boldness.
Question 8: Which attribute links a <label> to an <input>?
Explanation: The for attribute matches the input's id.
Question 9: Which HTML element is used for sidebar or tangential content?
- <section>
- <aside>
- <article>
- <div>
Explanation: <aside> is used for content indirectly related to the main content.
Question 10: What is the default display type of a <span> element?
- Block
- Inline
- Inline-block
- None
Explanation: <span> is an inline element by default.
Question 11: Which element defines a caption for a table?
- <thead>
- <title>
- <caption>
- <summary>
Explanation: <caption> provides a title or description for a table.
Question 12: Which form method hides data from the URL?
Explanation: POST sends data in the request body instead of the URL.
Question 13: Which HTML tag defines table header cells?
Explanation: <th> defines header cells in tables.
Question 14: Which element groups related form controls?
- <form>
- <section>
- <fieldset>
- <div>
Explanation: <fieldset> logically groups related inputs.
Question 15: Which attribute makes an input field non-editable but selectable?
- disabled
- hidden
- readonly
- required
Explanation: readonly prevents editing but allows selection.
Question 16: Which HTML element represents emphasized text semantically?
Explanation: <em> conveys emphasis with semantic meaning.
Question 17: Which tag is used to represent date and time values?
Explanation: <time> represents machine-readable date or time.
Question 18: Which attribute allows selecting multiple files in an upload field?
Explanation: The multiple attribute enables multiple file selection.
Question 19: Which element is best for grouping related headings and content?
- <div>
- <section>
- <span>
- <main>
Explanation: <section> groups related thematic content.
Question 20: Which tag embeds another HTML document within a page?
- <embed>
- <object>
- <iframe>
- <external>
Explanation: <iframe> embeds external web pages.
Question 21: Which ARIA attribute improves form accessibility?
- value
- name
- aria-label
- placeholder
Explanation: aria-label provides accessible labels for screen readers.
Question 22: Which element defines a description list?
Explanation: <dl> defines a description list.
Question 23: Which tag defines the term in a description list?
Explanation: <dt> represents the term being described.
Question 24: Which tag defines the description of a term?
Explanation: <dd> provides the description for a term.
Question 25: Which attribute is used to apply inline CSS?
Explanation: The style attribute applies inline CSS rules.
Question 26: Which element is used for short inline quotations?
- <blockquote>
- <q>
- <cite>
- <quote>
Explanation: <q> is used for short inline quotes.
Question 27: Which element is used for long quotations?
- <q>
- <blockquote>
- <cite>
- <quote>
Explanation: <blockquote> is for long quoted sections.
Question 28: Which form attribute specifies where data is sent?
Explanation: The action attribute defines the submission URL.
Question 29: Which HTML element represents task completion progress?
- <meter>
- <range>
- <progress>
- <status>
Explanation: <progress> shows task completion status.
Question 30: Which element represents a known range measurement?
- <progress>
- <value>
- <meter>
- <range>
Explanation: <meter> represents scalar measurements.
Question 31: Which tag overrides text direction?
- <dir>
- <rtl>
- <bdo>
- <direction>
Explanation: <bdo> overrides the text direction.
Question 32: Which attribute completely disables an input field?
- readonly
- hidden
- disabled
- inactive
Explanation: disabled prevents any interaction with the field.
Question 33: Which element represents keyboard input?
Explanation: <kbd> represents keyboard input.
Question 34: Which tag is used for sample program output?
- <output>
- <samp>
- <code>
- <var>
Explanation: <samp> represents sample output.
Question 35: Which element represents a variable in code examples?
Explanation: <var> represents variables.
Question 36: Which element hides content until user interaction?
- <content>
- <details>
- <aside>
- <output>
Explanation: <details> hides content until expanded.
Question 37: Which tag provides a label for <details>?
- <header>
- <summary>
- <caption>
- <title>
Explanation: <summary> provides a visible heading for details.
Question 38: Which attribute helps search engines understand images?
Explanation: alt text improves accessibility and SEO.
Question 39: Which HTML element should not be nested inside <p>?
Explanation: Block-level elements like <div> cannot be inside <p>.
Question 40: Which attribute enables lazy loading for images?
- async
- lazy
- loading='lazy'
- defer
Explanation: loading='lazy' defers image loading.
Question 41: Which element displays the result of a calculation?
- <value>
- <result>
- <output>
- <calc>
Explanation: <output> represents calculation results.
Question 42: Which element improves document structure for SEO?
Explanation: <section> improves semantic document structure.
Question 43: Which tag groups footer content for a section?
- <bottom>
- <footer>
- <aside>
- <section>
Explanation: <footer> represents footer content.
Question 44: Which attribute specifies relationship between current and linked document?
Explanation: rel defines the relationship of the linked resource.
Question 45: Which element represents machine-readable content values?
- <time>
- <data>
- <meta>
- <value>
Explanation: <data> links content with machine-readable values.
Question 46: Which HTML element represents the main heading group?
- <header>
- <head>
- <title>
- <main>
Explanation: <header> contains introductory content and headings.
Question 47: Which tag is used to group content without semantic meaning?
- <article>
- <section>
- <div>
- <aside>
Explanation: <div> is a non-semantic container.