This comprehensive collection of HTML MCQs is specifically crafted to enhance understanding of the fundamental concepts and techniques that form the foundation of web development. Covering key topics such as HTML elements, document structure, semantic markup, forms, and multimedia integration, these questions aim to reinforce both theoretical knowledge and practical skills. Ideal for students studying web design, computer science, or information technology, as well as professionals looking to refresh their HTML skills or prepare for certification exams, this set focuses on the essential elements that contribute to creating well-structured and accessible web pages.
Who should practice HTML MCQs?
- Students preparing for exams in web development, computer science, or related fields.
- Professionals seeking to strengthen their foundational knowledge of HTML for career advancement in web design and development.
- Candidates preparing for certification exams in web technologies or front-end development.
- Individuals looking to refresh their knowledge of HTML and its best practices for modern web design.
- Anyone interested in building a strong foundation in HTML to pursue further studies or a career in web development, user experience (UX) design, or digital content creation
1. What does HTML stand for?
A) Hyper Text Markup Language
B) Hyperlink and Text Markup Language
C) High Text Markup Language
D) Hyper Text Markup Link
View AnswerA
2. Which HTML tag is used to define an internal style sheet?
A) <style>
B) <css>
C) <script>
D) <link>
View AnswerA
3. Which of the following elements is used to create a hyperlink in HTML?
A) <link>
B) <a>
C) <href>
D) <url>
View AnswerB
4. Which HTML tag is used to create a line break?
A) <break>
B) <lb>
C) <br>
D) <line>
View AnswerC
5. What is the correct HTML element for inserting a line break?
A) <break>
B) <br>
C) <lb>
D) <line>
View AnswerB
6. What attribute is used to specify the URL of the page a link goes to?
A) src
B) href
C) link
D) url
View AnswerB
7. Which HTML element defines the title of a document?
A) <head>
B) <title>
C) <meta>
D) <header>
View AnswerB
8. What is the purpose of the <meta>
tag in HTML?
A) To define page content
B) To specify document metadata
C) To insert images
D) To create headings
View AnswerB
9. Which tag is used to define an unordered list in HTML?
A) <ol>
B) <ul>
C) <li>
D) <list>
View AnswerB
10. How do you create a checkbox in HTML?
A) <input type="checkbox">
B) <checkbox>
C) <input type="check">
D) <box type="checkbox">
View AnswerA
11. Which tag is used to define an ordered list?
A) <ul>
B) <ol>
C) <list>
D) <li>
View AnswerB
12. What is the correct way to insert an image in HTML?
A) <img src="image.jpg" alt="My Image">
B) <image src="image.jpg" alt="My Image">
C) <img href="image.jpg" alt="My Image">
D) <img url="image.jpg" alt="My Image">
View AnswerA
13. Which of the following is the correct way to create a hyperlink that opens in a new tab?
A) <a href="url" target="_blank">Link</a>
B) <a href="url" newtab="true">Link</a>
C) <link href="url" target="_new">Link</link>
D) <a url="url" open="new">Link</a>
View AnswerA
14. Which HTML tag is used to define the main content of a webpage?
A) <main>
B) <body>
C) <content>
D) <section>
View AnswerA
15. What is the correct syntax for creating a text area in HTML?
A) <textarea rows="4" cols="50"></textarea>
B) <textArea rows="4" cols="50"></textArea>
C) <textarea></textarea>
D) <text area rows="4" cols="50"></text area>
View AnswerA
16. Which attribute is used to provide an alternative text for an image?
A) alt
B) title
C) src
D) href
View AnswerA
17. How can you create a dropdown list in HTML?
A) <select><option></option></select>
B) <dropdown><option></dropdown>
C) <list><item></item></list>
D) <input type="dropdown">
View AnswerA
18. What is the purpose of the <!DOCTYPE html>
declaration?
A) To define the HTML version
B) To specify the document type
C) To declare the start of an HTML document
D) All of the above
View AnswerD
19. Which tag is used to define a table in HTML?
A) <table>
B) <tab>
C) <tbl>
D) <tbody>
View AnswerA
20. How do you define a header in HTML5?
A) <header>
B) <head>
C) <h1>
D) <hgroup>
View AnswerA
21. What tag is used to define a table row?
A) <tr>
B) <td>
C) <th>
D) <table>
View AnswerA
22. How do you create a footer in HTML5?
A) <footer>
B) <bottom>
C) <foot>
D) <footergroup>
View AnswerA
23. Which HTML attribute is used to specify inline styles?
A) class
B) style
C) font
D) text
View AnswerB
24. What is the purpose of the <link>
tag in HTML?
A) To link to external resources
B) To create hyperlinks
C) To embed images
D) To define styles
View AnswerA
25. Which HTML tag is used to define a section of navigation links?
A) <nav>
B) <navigation>
C) <menu>
D) <link>
View AnswerA
26. What is the default heading size of the <h1>
tag?
A) 12px
B) 14px
C) 16px
D) 32px
View AnswerD
27. How do you specify a title for an HTML document?
A) <title>Document Title</title>
B) <head><title>Document Title</title></head>
C) <html><title>Document Title</title></html>
D) All of the above
View AnswerD
28. What is the correct way to comment in HTML?
A) <!-- This is a comment -->
B) // This is a comment
C) /* This is a comment */
D) ** This is a comment **
View AnswerA
29. Which HTML element is used for creating a form?
A) <input>
B) <form>
C) <field>
D) <submit>
View AnswerB
30. What is the purpose of the action
attribute in a form tag?
A) To define the type of form
B) To specify the URL where the form data will be sent
C) To style the form
D) To validate form data
View AnswerB
31. How do you create a radio button in HTML?
A) <input type="radio">
B) <radio>
C) <input type="radioButton">
D) <input type="check">
View AnswerA
32. Which HTML element is used to display a picture?
A) <img>
B) <picture>
C) <image>
D) <src>
View AnswerA
33. Which tag is used to define a caption for a table?
A) <caption>
B) <title>
C) <header>
D) <th>
View AnswerA
34. How can you add a background color in HTML?
A) Using <style>
B) Using <bgcolor>
attribute
C) Using <background>
tag
D) All of the above
View AnswerA
35. What is the correct HTML for creating a hyperlink?
A) <a href="https://www.example.com">Visit Example</a>
B) <link href="https://www.example.com">Visit Example</link>
C) <url="https://www.example.com">Visit Example</url>
D) <a link="https://www.example.com">Visit Example</a>
View AnswerA
36. Which tag is used to define a cell in a table?
A) <td>
B) <th>
C) <tr>
D) <cell>
View AnswerA
37. What is the purpose of the <head>
tag in HTML?
A) To contain the main content of the page
B) To hold metadata and links to scripts and styles
C) To define the footer of the page
D) To create hyperlinks
View AnswerB
38. Which tag is used to define a bold text in HTML?
A) <strong>
B) <bold>
C) <b>
D) Both A and C
View AnswerD
39. What does the <iframe>
tag do in HTML?
A) It creates a frame for displaying content
B) It embeds another document within the current HTML document
C) It defines a table row
D) It is used for inline styles
View AnswerB
40. Which HTML tag is used to create a text input field?
A) <text>
B) <input type="text">
C) <textfield>
D) <input text>
View AnswerB
41. What does the <section>
tag represent in HTML5?
A) A generic container for content
B) A thematic grouping of content
C) A type of table
D) A form element
View AnswerB
42. Which of the following is not a valid HTML tag?
A) <div>
B) <span>
C) <element>
D) <p>
View AnswerC
43. How do you create a submit button in HTML?
A) <input type="button">
B) <button type="submit">Submit</button>
C) <submit>
D) Both A and B
View AnswerD
44. What is the role of the id
attribute in HTML?
A) To style elements
B) To provide a unique identifier for an HTML element
C) To link stylesheets
D) To define scripts
View AnswerB
45. Which of the following elements is self-closing?
A) <p>
B) <div>
C) <img>
D) <h1>
View AnswerC
46. What is the correct way to create a bulleted list?
A) <ul><li>Item</li></ul>
B) <list><item>Item</item></list>
C) <ol><li>Item</li></ol>
D) <ul>Item</ul>
View AnswerA
47. Which HTML tag is used to define the structure of a form?
A) <form>
B) <input>
C) <button>
D) <field>
View AnswerA
48. How do you specify the character set for an HTML document?
A) <meta charset="UTF-8">
B) <meta character="UTF-8">
C) <charset="UTF-8">
D) <meta set="UTF-8">
View AnswerA
49. What does the <address>
tag in HTML represent?
A) It defines the location of a webpage
B) It provides contact information for the author/owner of the document
C) It creates a link to an external page
D) It is used for styling purposes
View AnswerB
50. Which HTML element is used to define emphasized text?
A) <strong>
B) <em>
C) <i>
D) <b>
View AnswerB
51. What is the correct way to create an HTML comment?
A) // This is a comment
B) /* This is a comment */
C) <!-- This is a comment -->
D) ** This is a comment **
View AnswerC
52. How do you define a header in HTML5?
A) <header>
B) <h1>
C) <head>
D) <top>
View AnswerA
53. What is the role of the <footer>
tag in HTML?
A) To define the main content
B) To specify metadata
C) To define the footer for a section or page
D) To create hyperlinks
View AnswerC
54. Which HTML element is used to create a clickable button?
A) <button>
B) <click>
C) <input type="button">
D) Both A and C
View AnswerD
55. Which attribute of the <img>
tag specifies the image’s URL?
A) src
B) href
C) link
D) url
View AnswerA
56. What is the purpose of the <blockquote>
tag?
A) To define a section of content
B) To display a long quotation
C) To create a list
D) To define navigation links
View AnswerB
57. How do you create a numbered list in HTML?
A) <ul><li>Item</li></ul>
B) <list><item>Item</item></list>
C) <ol><li>Item</li></ol>
D) <ol>Item</ol>
View AnswerC
58. What does the <canvas>
tag do in HTML?
A) It defines a section for drawing graphics via JavaScript
B) It is used to create forms
C) It displays images
D) It is a styling element
View AnswerA
59. How do you create a tooltip in HTML?
A) Using the title
attribute on an element
B) Using the <tooltip>
tag
C) Using the <hover>
attribute
D) Using the <info>
tag
View AnswerA
60. Which attribute is used to specify the target for a link?
A) target
B) href
C) action
D) link
View AnswerA
61. What is the purpose of the <noscript>
tag?
A) To provide fallback content for browsers that do not support JavaScript
B) To define non-script content
C) To specify styles for non-JavaScript content
D) To comment out JavaScript code
View AnswerA
62. How can you make a list item bold in HTML?
A) <li><b>Item</b></li>
B) <li><strong>Item</strong></li>
C) Both A and B
D) <li><bold>Item</bold></li>
View AnswerC
63. Which tag is used to display a horizontal rule?
A) <hr>
B) <line>
C) <rule>
D) <hrule>
View AnswerA
64. What does the method
attribute specify in a form?
A) The form’s style
B) The URL to send the form data to
C) The HTTP method to be used when sending form data
D) The character set of the form
View AnswerC
65. Which HTML tag is used to define a navigation list?
A) <nav>
B) <navigation>
C) <menu>
D) <link>
View AnswerA
66. How do you define a fieldset in a form?
A) <fieldset>
B) <field>
C) <group>
D) <formset>
View AnswerA
67. Which tag is used for defining a table header?
A) <th>
B) <header>
C) <tr>
D) <td>
View AnswerA
68. How do you create a reset button in an HTML form?
A) <input type="reset">
B) <button type="reset">Reset</button>
C) Both A and B
D) <reset>
View AnswerC
69. What is the default value of the type
attribute for an <input>
element?
A) text
B) button
C) submit
D) password
View AnswerA
70. How do you create a text area in HTML?
A) <textarea rows="4" cols="50"></textarea>
B) <textArea></textArea>
C) <input type="textarea">
D) <area></area>
View AnswerA
71. Which of the following tags is used to define an important text?
A) <strong>
B) <important>
C) <b>
D) <em>
View AnswerA
72. How do you specify the size of a text input field in HTML?
A) <input type="text" size="20">
B) <input type="text" length="20">
C) <input type="text" width="20">
D) <input type="text" width="20px">
View AnswerA
73. Which tag is used to define a dropdown list?
A) <select>
B) <dropdown>
C) <list>
D) <option>
View AnswerA
74. What is the purpose of the <input type="file">
element?
A) To upload files
B) To display images
C) To create a text field
D) To generate random numbers
View AnswerA
75. Which tag is used for a block-level quotation?
A) <quote>
B) <blockquote>
C) <q>
D) <cite>
View AnswerB
76. How do you specify a placeholder in an input field?
A) <input placeholder="Enter text">
B) <input value="Enter text">
C) <input hint="Enter text">
D) <input type="text" place="Enter text">
View AnswerA
77. Which attribute is used to specify the number of rows in a text area?
A) rows
B) cols
C) height
D) lines
View AnswerA
78. What does the target="_self"
attribute do in a link?
A) Opens the link in a new tab
B) Opens the link in the same frame as it was clicked
C) Opens the link in a parent frame
D) Opens the link in a new window
View AnswerB
79. Which HTML element is used to define a container for SVG graphics?
A) <svg>
B) <canvas>
C) <image>
D) <vector>
View AnswerA
80. What does the colspan
attribute do in a table?
A) Defines the number of columns a cell should span
B) Defines the number of rows a cell should span
C) Specifies the background color of a cell
D) Merges two tables
View AnswerA
81. How do you include JavaScript in an HTML document?
A) <script src="script.js"></script>
B) <javascript src="script.js"></javascript>
C) <js src="script.js"></js>
D) <code src="script.js"></code>
View AnswerA
82. What is the purpose of the disabled
attribute in a form element?
A) To make the element visible
B) To make the element unresponsive
C) To style the element
D) To hide the element
View AnswerB
83. Which HTML tag is used to define a definition list?
A) <dl>
B) <list>
C) <definition>
D) <def>
View AnswerA
84. How do you create a mailto link in HTML?
A) <a href="mailto:someone@example.com">Email</a>
B) <link href="mailto:someone@example.com">Email</link>
C) <a mailto="someone@example.com">Email</a>
D) <mail href="someone@example.com">Email</mail>
View AnswerA
85. What is the purpose of the <script>
tag in HTML?
A) To include CSS styles
B) To embed JavaScript code
C) To create hyperlinks
D) To define metadata
View AnswerB
86. Which HTML tag is used to define an inline frame?
A) <iframe>
B) <frame>
C) <inline>
D) <img>
View AnswerA
87. How do you specify the height of a table row in HTML?
A) Using the height
attribute in <tr>
B) Using the style
attribute in <td>
C) Using CSS only
D) All of the above
View AnswerD
88. What does the required
attribute do in a form input?
A) Makes the field optional
B) Makes the field mandatory to fill out
C) Specifies the type of data
D) Styles the input
View AnswerB
89. Which tag is used to define a progress bar in HTML5?
A) <progress>
B) <meter>
C) <bar>
D) <status>
View AnswerA
90. How do you create a tooltip in HTML?
A) By using the title
attribute
B) By using the <tooltip>
tag
C) By using CSS only
D) By using JavaScript only
View AnswerA
91. What is the correct HTML for creating a checkbox?
A) <input type="check">
B) <input type="checkbox">
C) <checkbox>
D) <input check="true">
View AnswerB
92. Which HTML element is used for defining a set of options in a dropdown list?
A) <option>
B) <select>
C) <list>
D) <choice>
View AnswerA
93. What does the alt
attribute in an image tag do?
A) Provides alternative text for the image
B) Specifies the image source
C) Defines the image width
D) Specifies the image height
View AnswerA
94. Which HTML element is used to create a table footer?
A) <tfoot>
B) <footer>
C) <tfooting>
D) <tablefooter>
View AnswerA
95. How do you specify a CSS file in HTML?
A) <link rel="stylesheet" href="styles.css">
B) <style src="styles.css">
C) <css href="styles.css">
D) <link href="styles.css">
View AnswerA
96. What is the correct way to create a text input field with a default value?
A) <input type="text" value="Default Text">
B) <input default="Default Text">
C) <textinput value="Default Text">
D) <input type="text" placeholder="Default Text">
View AnswerA
97. How do you create a button that submits a form?
A) <input type="submit">
B) <button type="submit">Submit</button>
C) Both A and B
D) <button>Submit</button>
View AnswerC
98. What does the maxlength
attribute do in an input field?
A) Limits the number of characters that can be entered
B) Sets the maximum height of the input field
C) Limits the number of lines in a text area
D) Sets the maximum width of the input field
View AnswerA
99. How do you create a file upload field in HTML?
A) <input type="upload">
B) <input type="file">
C) <fileinput>
D) <input type="attachment">
View AnswerB
100. What is the purpose of the <summary>
tag in HTML?
A) To provide a summary of a document
B) To create collapsible content in a <details>
tag
C) To summarize data in a table
D) To define a list of items
View AnswerB