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 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 <i...
📸 HTML Image Gallery Tutorial for Beginners Image galleries make your website more beautiful and professional. In this tutorial, you will learn how to create different types of image galleries using HTML and CSS. 📌 1. Simple HTML Image Gallery This is the most basic gallery layout. <div> <img src="image1.jpg" width="200"> <img src="image2.jpg" width="200"> <img src="image3.jpg" width="200"> </div> ✔ Explanation All images are inside a <div> Each image has the same width They appear in a row 📌 2. Responsive Image Gallery (CSS Grid) This gallery automatically adjusts on mobile and PC. <style> .gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 15px; } .gallery img { width: 100%; border-radius: 10px; } </style> <div class="galle...
📝 HTML Notes App Tutorial for Beginners (Full Project) In this tutorial, you will learn how to build a fully functional Notes App using HTML, CSS, and JavaScript. This app works on all devices and saves notes even after refreshing the page! ✨ Features of This Notes App Add new notes Edit notes Delete notes Dark Mode Search notes Auto-save using LocalStorage No backend needed 📌 Step 1 — HTML Structure Copy Code Run Demo <div class="container"> <h1>Notes App</h1> <button id="toggleDark">🌙 Dark Mode</button> <input type="text" id="searchBox" placeholder="Search notes..."> <textarea id="noteInput" placeholder="Write your note here..."></textarea> <button id="addNote">Add Note</button> <div id="notesList"></div> ...
HTML Tags Tutorial – A Complete Beginner-Friendly Guide HTML tags are the basic building blocks of every webpage. Whether you want to create a simple webpage or a full website, understanding HTML tags is the first and most important step. In this post, we’ll explore what HTML tags are, how they work, why they matter, and the most commonly used tags with examples. Table of Contents What Are HTML Tags? How HTML Tags Work Types of HTML Tags Most Common HTML Tags Self-Closing Tags Nesting Tags Practical Examples Best Practices What Are HTML Tags? HTML tags are keywords enclosed in angle brackets < > that tell the browser how to display content. Tags create elements such as headings, paragraphs, images, links, lists, buttons, forms, and much more. Example of a simple tag: <p>This is a paragraph.</p> How HTML Tags Work Most HTML tags come in pairs: <opening-tag>...
HTML Images Tutorial HTML Images Tutorial The <img> tag is used to display images on a webpage. In this tutorial, you'll learn how to add images, resize them, add borders, captions, and more. 1. Basic Image Tag The simplest way to add an image is by using the src and alt attributes. <img src="image.jpg" alt="My Image"> Attributes: src → Image URL alt → Text shown if image fails to load 2. Image Size (width & height) You can resize an image using width or height . <img src="photo.jpg" width="300" height="200"> 3. Responsive Images Responsive images automatically adjust to device size. <img src="photo.jpg" style="width:100%;max-width:400px;"> 4. Add Border to Images <img src="file.jpg" style="border:3px solid #333;...