Skip to main content

100 HTML Multiple-Choice Questions (MCQs) — Test Your Knowledge

Practice these 100 HTML MCQs to test your basics to advanced knowledge. Click Show Answer to reveal the correct option. Use this for studying, quizzes, or classroom exercises.

1. Which tag defines the root of an HTML document?
A. <body>
B. <head>
C. <html>
D. <document>
Answer: C. <html>
2. Which tag is used to create a hyperlink?
A. <link>
B. <a>
C. <href>
D. <url>
Answer: B. <a>
3. Which attribute specifies the URL in <a> tag?
A. src
B. link
C. href
D. url
Answer: C. href
4. Which tag is used to display an image?
A. <img>
B. <image>
C. <picture>
D. <src>
Answer: A. <img>
5. The correct HTML element for the largest heading is:
A. <heading>
B. <h6>
C. <h1>
D. <head>
Answer: C. <h1>
6. Which tag places content in the browser title bar?
A. <meta>
B. <title>
C. <head>
D. <header>
Answer: B. <title>
7. Which HTML attribute is used to define inline styles?
A. style
B. class
C. styles
D. font
Answer: A. style
8. Which element is used for an unordered list?
A. <ol>
B. <ul>
C. <li>
D. <list>
Answer: B. <ul>
9. The <li> tag defines a:
A. Table row
B. List item
C. Link
D. Heading
Answer: B. List item
10. Which tag is used to create a table?
A. <table>
B. <tab>
C. <tbody>
D. <tr>
Answer: A. <table>
11. Which tag defines a table row?
A. <td>
B. <tr>
C. <th>
D. <row>
Answer: B. <tr>
12. Which tag is used for table header cell?
A. <td>
B. <th>
C. <thead>
D. <caption>
Answer: B. <th>
13. Which tag is used to define a paragraph?
A. <p>
B. <para>
C. <text>
D. <article>
Answer: A. <p>
14. Which tag is used for an ordered list?
A. <ul>
B. <ol>
C. <list>
D. <dl>
Answer: B. <ol>
15. Which tag is used to define a description list?
A. <dl>
B. <dt>
C. <dd>
D. <list>
Answer: A. <dl>
16. Which attribute adds alternative text to an image?
A. title
B. alt
C. text
D. descr
Answer: B. alt
17. Which tag is used to embed audio?
A. <audio>
B. <sound>
C. <music>
D. <mp3>
Answer: A. <audio>
18. Which tag is used to embed video?
A. <movie>
B. <video>
C. <media>
D. <mp4>
Answer: B. <video>
19. The <meta> tag is used for:
A. Adding meta information (SEO, charset)
B. Adding media
C. Creating menus
D. Embedding scripts
Answer: A. Adding meta information
20. Which attribute makes a link open in new tab?
A. target="_self"
B. rel="noopener"
C. target="_blank"
D. open="new"
Answer: C. target="_blank"
21. Which input type allows multiple lines of text?
A. <input type="text">
B. <textarea>
C. <input type="multiline">
D. <box>
Answer: B. <textarea>
22. Which form element is used to select one of many options?
A. <checkbox>
B. <select>
C. <option>
D. <radio>
Answer: B. <select>
23. Which attribute specifies an input name sent to server?
A. id
B. name
C. value
D. form
Answer: B. name
24. Which tag is used to include JavaScript?
A. <js>
B. <script>
C. <javascript>
D. <code>
Answer: B. <script>
25. The correct way to comment in HTML is:
A. // comment
B. /* comment */
C. <!-- comment -->
D. <comment>
Answer: C. <!-- comment -->
26. Which tag is semantic for primary navigation?
A. <nav>
B. <menu>
C. <navigation>
D. <ul>
Answer: A. <nav>
27. Which meta tag sets character encoding?
A. <meta name="viewport">
B. <meta charset="UTF-8">
C. <meta http-equiv>
D. <meta name="description">
Answer: B. <meta charset="UTF-8">
28. Which tag is used for page footer?
A. <foot>
B. <footer>
C. <bottom>
D. <section>
Answer: B. <footer>
29. Which tag is used to group form controls?
A. <fieldset>
B. <group>
C. <controls>
D. <formgroup>
Answer: A. <fieldset>
30. Which attribute is used to disable an input?
A. readonly
B. disabled
C. off
D. block
Answer: B. disabled
31. Which tag is used to define a division or a section?
A. <section>
B. <div>
C. <span>
D. Both A and B
Answer: D. Both A and B
32. Which tag is inline by default?
A. <div>
B. <span>
C. <h1>
D. <p>
Answer: B. <span>
33. Which tag provides a tooltip text on hover?
A. title attribute
B. <tooltip>
C. <abbr>
D. <tip>
Answer: A. title attribute
34. Which tag is used for self-closing elements like <br>?
A. Void elements
B. Empty tags
C. Self tags
D. Closed tags
Answer: A. Void elements
35. Which tag is used to define a clickable area on an image map?
A. <area>
B. <map>
C. <imgarea>
D. <hotspot>
Answer: A. <area>
36. What does the <canvas> element do?
A. Draw graphics via scripting (JS)
B. Insert video
C. Insert audio
D. Add forms
Answer: A. Draw graphics via scripting
37. Which attribute is used to specify the relationship of the linked document?
A. rel
B. href
C. type
D. link
Answer: A. rel
38. Which tag is used for embedding external content like maps?
A. <embed>
B. <iframe>
C. <object>
D. All of the above
Answer: D. All of the above
39. Which attribute is used with <form> to specify where to send form-data?
A. action
B. method
C. enctype
D. name
Answer: A. action
40. Which <input> type is used to upload files?
A. type="file"
B. type="upload"
C. type="folder"
D. type="image"
Answer: A. type="file"
41. Which attribute is used to specify a checkbox state as checked by default?
A. checked
B. selected
C. default
D. active
Answer: A. checked
42. Which attribute provides a short hint that describes the expected value of an input?
A. value
B. title
C. placeholder
D. hint
Answer: C. placeholder
43. Which HTML element is used to specify a footer for a document or section?
A. <bottom>
B. <footer>
C. <section>
D. <aside>
Answer: B. <footer>
44. Which tag represents a self-contained composition in a document?
A. <section>
B. <article>
C. <div>
D. <aside>
Answer: B. <article>
45. Which tag is used to embed SVG content?
A. <svg>
B. <vector>
C. <img src="svg">
D. <canvas>
Answer: A. <svg>
46. Which attribute is required for accessibility to describe an image?
A. title
B. alt
C. desc
D. role
Answer: B. alt
47. Which attribute is used to define the text direction?
A. dir
B. direction
C. lang
D. rtl
Answer: A. dir
48. Which attribute specifies visible input value inside a button?
A. value
B. label
C. name
D. text
Answer: A. value
49. Which tag marks the beginning of the document head section?
A. <head>
B. <header>
C. <meta>
D. <title>
Answer: A. <head>
50. Which tag is used to define contact information for the author?
A. <address>
B. <contact>
C. <author>
D. <info>
Answer: A. <address>
51. Which attribute specifies image source for <img>?
A. src
B. href
C. link
D. data
Answer: A. src
52. Which tag defines a caption for a <table>?
A. <caption>
B. <head>
C. <title>
D. <summary>
Answer: A. <caption>
53. Which tag is used to embed a video from YouTube?
A. <embed>
B. <iframe>
C. <video src>
D. <youtube>
Answer: B. <iframe>
54. Which attribute adds a tooltip to any element?
A. hint
B. caption
C. title
D. alt
Answer: C. title
55. Which tag is used to create a checkbox?
A. <input type="checkbox">
B. <check>
C. <option>
D. <box>
Answer: A. <input type="checkbox">
56. Which attribute defines media queries for responsive design?
A. href
B. media
C. rel
D. type
Answer: B. media
57. Which tag is used to link CSS file?
A. <style>
B. <link rel="stylesheet">
C. <css>
D. <import>
Answer: B. <link rel="stylesheet">
58. Which tag reads the character set of the document?
A. <meta charset>
B. <meta set>
C. <encoding>
D. <charset>
Answer: A. <meta charset>
59. Which attribute is used to make a form send data using POST method?
A. method="get"
B. method="post"
C. send="post"
D. action="post"
Answer: B. method="post"
60. Which tag is used to define an abbreviation?
A. <abbr>
B. <acronym>
C. <short>
D. <abbrv>
Answer: A. <abbr>
61. Which is correct way to create a line break?
A. <br>
B. <break>
C. <lb>
D. <newline>
Answer: A. <br>
62. Which tag is used to define emphasized text?
A. <i>
B. <em>
C. <strong>
D. Both A and B
Answer: D. Both A and B
63. Which attribute is used to set language of a document?
A. lang
B. xml:lang
C. language
D. Both A and B
Answer: D. Both A and B
64. Which tag is used to group a set of <option> elements?
A. <group>
B. <optgroup>
C. <options>
D. <selectgroup>
Answer: B. <optgroup>
65. Which tag is used to define a subscript?
A. <sub>
B. <sup>
C. <small>
D. <lower>
Answer: A. <sub>
66. Which tag is used to define a superscript?
A. <super>
B. <sup>
C. <power>
D. <up>
Answer: B. <sup>
67. Which tag is used to display preformatted text?
A. <pre>
B. <code>
C. <samp>
D. <var>
Answer: A. <pre>
68. Which tag is used to define keyboard input?
A. <kbd>
B. <key>
C. <input type="key">
D. <code>
Answer: A. <kbd>
69. Which tag is used to define sample output?
A. <output>
B. <sample>
C. <samp>
D. <result>
Answer: C. <samp>
70. Which attribute prevents a form from being submitted?
A. novalidate
B. disabled
C. prevent
D. stop
Answer: A. novalidate
71. Which tag is used for an interactive form control that submits data?
A. <button type="submit">
B. <input type="submit">
C. Both A and B
D. <submit>
Answer: C. Both A and B
72. Which tag would you use for marked/highlighted text?
A. <mark>
B. <highlight>
C. <strong>
D. <em>
Answer: A. <mark>
73. Which attribute is used to preload video data?
A. preload
B. buffer
C. src
D. autobuffer
Answer: A. preload
74. Which attribute is used with <audio> to loop playback?
A. repeat
B. loop
C. forever
D. looped
Answer: B. loop
75. Which attribute is used to provide subtitles to <video>?
A. <subtitle>
B. <track>
C. <caption>
D. <texttrack>
Answer: B. <track>
76. Which element represents a caption for an iframe?
A. <caption>
B. <title>
C. No specific caption element
D. <figcaption>
Answer: C. No specific caption element (use <figure> & <figcaption> if needed)
77. Which attribute indicates that an input field must be filled out?
A. required
B. validate
C. must
D. necessary
Answer: A. required
78. Which tag is used to embed an external SVG file?
A. <img src="file.svg">
B. <object data="file.svg">
C. <embed src="file.svg">
D. All of the above
Answer: D. All of the above
79. Which tag can be used to define navigation breadcrumbs?
A. <nav>
B. <ol> with <li>
C. <ul> with <li>
D. All of the above
Answer: D. All of the above
80. Which attribute indicates that an input should have focus when page loads?
A. autofocus
B. focus
C. auto
D. focusable
Answer: A. autofocus
81. Which tag is used to embed a CSS stylesheet inside HTML?
A. <css>
B. <style>
C. <link>
D. <format>
Answer: B. <style>
82. Which attribute in <table> adds a summary (deprecated)?
A. caption
B. summary
C. desc
D. title
Answer: B. summary (deprecated)
83. Which attribute is used to set default value for <input>?
A. default
B. value
C. placeholder
D. init
Answer: B. value
84. Which tag defines a block of quoted text from another source?
A. <q>
B. <blockquote>
C. <cite>
D. <quote>
Answer: B. <blockquote>
85. Which attribute sets the size of text input in chars?
A. maxlength
B. size
C. length
D. width
Answer: B. size
86. Which tag is used to define a caption for an image?
A. <figcaption>
B. <caption>
C. <legend>
D. <note>
Answer: A. <figcaption>
87. Which attribute indicates input type is password?
A. type="password"
B. secure="true"
C. secret
D. private
Answer: A. type="password"
88. Which tag is used to group media (image + caption)?
A. <media>
B. <figure>
C. <content>
D. <group>
Answer: B. <figure>
89. Which tag defines a navigation list for search engines (sitemap)?
A. <nav>
B. <ul>
C. <ol>
D. None (sitemaps are XML)
Answer: D. None (sitemaps are XML)
90. Which attribute indicates that an image is decorative and should be ignored by screen readers?
A. alt=""
B. role="presentation"
C. aria-hidden="true"
D. All of the above
Answer: D. All of the above
91. Which attribute is used to specify a download for a link?
A. download
B. save
C. href
D. file
Answer: A. download
92. Which attribute is used to prevent content from being selectable?
A. user-select: none (CSS)
B. unselectable="on"
C. disabled
D. none
Answer: A. user-select: none (CSS)
93. Which tag is used to define a progress bar?
A. <progress>
B. <meter>
C. <bar>
D. <progressbar>
Answer: A. <progress>
94. Which tag is used to define a gauge (value within a range)?
A. <progress>
B. <meter>
C. <gauge>
D. <range>
Answer: B. <meter>
95. Which attribute is used to add ARIA role for accessibility?
A. role
B. aria
C. accessibility
D. arole
Answer: A. role
96. Which tag is used to include a favicon?
A. <link rel="icon" href="favicon.ico">
B. <favicon>
C. <icon>
D. <shortcut icon>
Answer: A. <link rel="icon" href="favicon.ico">
97. Which HTML attribute is used to apply inline JavaScript to an element event?
A. onclick
B. onevent
C. event
D. js
Answer: A. onclick
98. Which tag is used to get user input for numeric range?
A. <input type="range">
B. <input type="number">
C. <slider>
D. <meter>
Answer: A. <input type="range">
99. Which tag is used for embedding external scripts (like analytics)?
A. <script src="...">
B. <embed src>
C. <link rel="script">
D. <source src>
Answer: A. <script src="...">
100. Which doctype declaration is correct for HTML5?
A. <!DOCTYPE HTML PUBLIC>
B. <!DOCTYPE html>
C. <!DOCTYPE html5>
D. <!HTML>
Answer: B. <!DOCTYPE html>

Tip: Use these MCQs to test yourself or your students. Click "Show All Answers" to reveal all and study quickly.

Comments

Popular posts from this blog

HTML Tables Tutorial — Learn Tables with Examples Tables organize tabular data (rows & columns). They are great for schedules, price lists, spec sheets, comparison charts, and any data that fits a grid. This guide covers: Table basics: <table> , <tr> , <td> , <th> Headers, captions, and groups ( <caption> , <thead> , <tbody> , <tfoot> ) Colspan & rowspan Styling and responsive tables Accessibility and best practices Table of Contents Basic Structure Headers & Captions Colspan & Rowspan Grouping Rows: thead / tbody / tfoot Styling Tables Responsive Tables Accessibility Tips Practical Examples Best Practices 1. Basic Structure Minimal valid table: <table> <tr> <td>Cell 1</td> <td>Cell 2</td> </tr> </table> Elements: <table> — container for the table <tr> — table ...
HTML Forms Tutorial HTML Forms Tutorial HTML Forms allow users to enter and submit data. They are used everywhere—login forms, signup forms, search boxes, feedback forms, etc. In this complete tutorial, you will learn all form elements with examples and demos. 1. What is an HTML Form? A form collects user input using different form elements like text fields, checkboxes, radio buttons, buttons, and more. <form> Form elements go here... </form> 2. Basic Form Structure <form action="#" method="post"> <input type="text" placeholder="Enter name"> <button>Submit</button> </form> Submit Attributes: action → URL where form data is sent method="POST" → Secure data sending method="GET" → Data shows in URL 3. Text Input Field <input type="text" placeholder="Your Name...
What is HTML? A Beginner-Friendly Explanation If you want to become a web developer, HTML is the first language you should learn. It is the foundation of every website on the internet. In simple words: HTML (HyperText Markup Language) is used to create the structure and content of a webpage. Why HTML is important? Websites cannot exist without HTML It is simple and beginner-friendly Used with CSS and JavaScript Works on all browsers How does HTML work? HTML is made of tags . Tags tell the browser what type of content is being shown. Example of an HTML tag: <p>This is a paragraph.</p> Here: <p> is the opening tag </p> is the closing tag The text inside is the content Basic HTML Page Example Below is a simple webpage example you can try: <!DOCTYPE html> <html> <head> <title>My First Webpage</title> </head> <body> <h1>Hello World!</h1> <p>This is my...