Top 100 HTML Mcqs with Answers | Master HTML


Master Your HTML Skills with These Engaging MCQs!

Are you ready to take your HTML knowledge to the next level? Dive into this carefully curated collection of Top 100 HTML Mcqs (multiple-choice questions) designed to challenge your understanding and boost your confidence. Whether you’re preparing for an exam, brushing up on your web development skills, or just curious about HTML, these questions cover a wide range of topics—from basic tags to advanced features.

Why Practice with These MCQs?

  • Enhance Your Understanding: Test your grasp of fundamental concepts and discover areas for improvement.
  • Exam Preparation: Perfect for students looking to ace their assessments and build a strong foundation in web development.
  • Quick Learning: Gain insights and explanations with each question, making it easier to learn on the go.

At the end there are tricky and difficult mcqs

Don’t miss out on the chance to refine your HTML skills and become a web development pro! Start exploring the questions below and see how much you really know!

html mcqs

1. What does HTML stand for?

  • a) Hyper Text Markup Language
  • b) Home Tool Markup Language
  • c) Hyperlinks and Text Markup Language
  • d) Hyper Tool Markup Language
a) Hyper Text Markup Language

2. Which HTML element is used for the largest heading?

  • a) <h1>
  • b) <h6>
  • c) <head>
  • d) <h2>
a) <h1>

3. Which HTML attribute specifies an alternate text for an image, if the image cannot be displayed?

  • a) alt
  • b) src
  • c) longdesc
  • d) title
a) alt

4. How do you create a hyperlink in HTML?

  • a) <a href="url">Link</a>
  • b) <a name="url">Link</a>
  • c) <a src="url">Link</a>
  • d) <a link="url">Link</a>
    Answer: a) <a href="url">Link</a>

5. Which of the following is the correct syntax for adding a background color in HTML?

  • a) <body color="yellow">
  • b) <body bg="yellow">
  • c) <body bgcolor="yellow">
  • d) <background color="yellow">
    Answer: c) <body bgcolor="yellow">

6. Which HTML element defines a paragraph?

  • a) <p>
  • b) <paragraph>
  • c) <para>
  • d) <pg>
    Answer: a) <p>

7. Which of the following is correct about HTML?

  • a) HTML is a programming language
  • b) HTML is a scripting language
  • c) HTML is used to structure content on the web
  • d) HTML is not case-sensitive
    Answer: c) HTML is used to structure content on the web

8. How can you make a numbered list in HTML?

  • a) <list>
  • b) <ul>
  • c) <dl>
  • d) <ol>
    Answer: d) <ol>

9. How can you make a bulleted list in HTML?

  • a) <list>
  • b) <ul>
  • c) <ol>
  • d) <dl>
    Answer: b) <ul>

10. What is the correct HTML tag for inserting a line break?

  • a) <br>
  • b) <lb>
  • c) <break>
  • d) <lnbr>
    Answer: a) <br>

11. Which HTML attribute is used to define inline styles?

  • a) font
  • b) class
  • c) styles
  • d) style
    Answer: d) style

12. Which of the following is not a valid HTML tag?

  • a) <div>
  • b) <span>
  • c) <section>
  • d) <sectionhead>
    Answer: d) <sectionhead>

13. What is the purpose of the <title> element in HTML?

  • a) To define a large heading
  • b) To set the background color of the web page
  • c) To display a title in the browser’s title bar or tab
  • d) To specify the page’s main content
    Answer: c) To display a title in the browser’s title bar or tab

14. What is the correct HTML tag for a horizontal rule?

  • a) <hr>
  • b) <line>
  • c) <rule>
  • d) <break>
    Answer: a) <hr>

15. In HTML, what does the <a> tag stand for?

  • a) Anchor
  • b) Alert
  • c) Address
  • d) Align
    Answer: a) Anchor

16. How do you comment out a section of code in HTML?

  • a) <!-- Comment -->
  • b) // Comment
  • c) /* Comment */
  • d) # Comment
    Answer: a) <!-- Comment -->

17. What is the correct syntax for creating an email link in HTML?

  • a) <a href="mail:someone@example.com">Email</a>
  • b) <a href="mailto:someone@example.com">Email</a>
  • c) <a href="email:someone@example.com">Email</a>
  • d) <a href="someone@example.com">Email</a>
    Answer: b) <a href="mailto:someone@example.com">Email</a>

18. Which HTML attribute is used to define the size of an image?

  • a) height
  • b) src
  • c) size
  • d) alt
    Answer: a) height

19. What does the <thead> tag define in a table?

  • a) Table footer
  • b) Table body
  • c) Table heading
  • d) Table column
    Answer: c) Table heading

20. What is the purpose of the <meta> tag in HTML?

  • a) To include multimedia content
  • b) To specify metadata about the web page
  • c) To create navigation menus
  • d) To embed scripts
    Answer: b) To specify metadata about the web page

21. Which HTML attribute is used to open a link in a new tab or window?

  • a) newtab
  • b) target
  • c) href
  • d) rel
    Answer: b) target

22. Which is the correct HTML element for inserting a line break?

  • a) <break>
  • b) <lb>
  • c) <br>
  • d) <newline>
    Answer: c) <br>

23. What is the correct HTML element for inserting a background image?

  • a) <background>
  • b) <img>
  • c) <body background="image.jpg">
  • d) <image>
    Answer: c) <body background="image.jpg">

24. Which HTML tag is used to define an unordered list?

  • a) <ul>
  • b) <ol>
  • c) <li>
  • d) <list>
    Answer: a) <ul>

25. How can you specify the height and width of an image in HTML?

  • a) <img height="100px" width="100px">
  • b) <image height="100px" width="100px">
  • c) <img size="100px">
  • d) <img dimension="100px">
    Answer: a) <img height="100px" width="100px">

26. Which HTML tag is used to create a drop-down list?

  • a) <list>
  • b) <dropdown>
  • c) <select>
  • d) <ul>
    Answer: c) <select>

27. What is the correct HTML tag for creating a text input field?

  • a) <input type="text">
  • b) <textfield>
  • c) <inputtext>
  • d) <textarea>
    Answer: a) <input type="text">

28. Which of the following HTML elements is used to create a checkbox?

  • a) <input type="radio">
  • b) <input type="checkbox">
  • c) <check>
  • d) <box>
    Answer: b) <input type="checkbox">

29. How can you create a multi-line text input in HTML?

  • a) <input type="textarea">
  • b) <textarea>
  • c) <input type="text" multiple>
  • d) <multiline>
    Answer: b) <textarea>

30. Which HTML tag is used to define an internal style sheet?

  • a) <style>
  • b) <css>
  • c) <script>
  • d) <link>
    Answer: a) <style>

31. What is the correct HTML element for playing video files?

  • a) <media>
  • b) <movie>
  • c) <video>
  • d) <embed>
    Answer: c) <video>

32. How do you specify a comment in HTML?

  • a) // This is a comment
  • b) /* This is a comment */
  • c) <!-- This is a comment -->
  • d) ** This is a comment **
    Answer: c) <!-- This is a comment -->

33. Which HTML tag is used to define a list item?

  • a) <li>
  • b) <item>
  • c) <list>
  • d) <ul>
    Answer: a) <li>

34. Which HTML attribute is used to define a link that should open in a new tab?

  • a) open
  • b) target=”_new”
  • c) target=”_blank”
  • d) ref=”_newtab”
    Answer: c) target=”_blank”

35. Which HTML tag is used to define a table row?

  • a) <td>
  • b) <tr>
  • c) <th>
  • d) <table>
    Answer: b) <tr>

36. Which attribute is used to specify a unique identifier for an HTML element?

  • a) class
  • b) id
  • c) ref
  • d) name
    Answer: b) id

37. How do you embed an audio file in HTML?

  • a) <audio src="audiofile.mp3">
  • b) <sound src="audiofile.mp3">
  • c) <play src="audiofile.mp3">
  • d) <media src="audiofile.mp3">
    Answer: a) <audio src="audiofile.mp3">

38. How can you create a hyperlink to an email address in HTML?

  • a) <a href="mailto:example@example.com">Email Us</a>
  • b) <a mail="example@example.com">Email Us</a>
  • c) <a email="example@example.com">Email Us</a>
  • d) <a href="emailto:example@example.com">Email Us</a>
    Answer: a) <a href="mailto:example@example.com">Email Us</a>

39. Which HTML element is used to define the main content of a document?

  • a) <main>
  • b) <content>
  • c) <section>
  • d) <div>
    Answer: a) <main>

40. What is the purpose of the <iframe> tag in HTML?

  • a) To embed a form
  • b) To embed another document within the current document
  • c) To define a clickable image
  • d) To insert a line break
    Answer: b) To embed another document within the current document

41. Which attribute is used to specify the location (URL) of an external style sheet?

  • a) src
  • b) link
  • c) href
  • d) style
    Answer: c) href

42. Which of the following is correct to add a video with controls in HTML?

  • a) <video controls src="video.mp4">
  • b) <video control="video.mp4">
  • c) <video src="video.mp4">
  • d) <video controls="on" src="video.mp4">
    Answer: a) <video controls src="video.mp4">

43. How do you specify a default value for a form input field?

  • a) default
  • b) value
  • c) placeholder
  • d) input
    Answer: b) value

44. Which of the following is a semantic HTML element?

  • a) <div>
  • b) <span>
  • c) <article>
  • d) <header>
    Answer: c) <article>

45. Which tag is used to display preformatted text in HTML?

  • a) <pre>
  • b) <code>
  • c) <p>
  • d) <formatted>
    Answer: a) <pre>

46. What is the correct HTML tag for creating an input field that allows users to upload files?

  • a) <input type="file">
  • b) <input type="upload">
  • c) <input type="submit">
  • d) <input type="image">
    Answer: a) <input type="file">

47. Which tag is used to create a table header in HTML?

  • a) <head>
  • b) <th>
  • c) <header>
  • d) <thead>
    Answer: b) <th>

48. How do you specify the cell padding in a table in HTML?

  • a) cellpadding
  • b) padding
  • c) cellspacing
  • d) space
    Answer: a) cellpadding

49. Which attribute is used to merge two or more table cells in HTML?

  • a) colspan
  • b) rowspan
  • c) merge
  • d) span
    Answer: a) colspan

50. What is the purpose of the <nav> tag in HTML?

  • a) To define a section for navigation links
  • b) To define a navigation toolbar
  • c) To display a menu
  • d) To list external resources
    Answer: a) To define a section for navigation links

51. Which tag is used to insert an image in HTML?

  • a) <img>
  • b) <image>
  • c) <pic>
  • d) <photo>
    Answer: a) <img>

52. What is the correct syntax to create an ordered list in HTML?

  • a) <ul><li>Item 1</li></ul>
  • b) <ol><li>Item 1</li></ol>
  • c) <dl><dt>Item 1</dt></dl>
  • d) <ol><item>Item 1</item></ol>
    Answer: b) <ol><li>Item 1</li></ol>

53. How can you specify a hyperlink that links to another section on the same page?

  • a) <a href="#section1">Go to Section 1</a>
  • b) <a link="section1">Go to Section 1</a>
  • c) <a goto="section1">Go to Section 1</a>
  • d) <a ref="section1">Go to Section 1</a>
    Answer: a) <a href="#section1">Go to Section 1</a>

54. Which of the following is not a valid HTML5 element?

  • a) <article>
  • b) <footer>
  • c) <blink>
  • d) <aside>
    Answer: c) <blink>

55. Which tag is used to display the table’s caption in HTML?

  • a) <title>
  • b) <caption>
  • c) <summary>
  • d) <header>
    Answer: b) <caption>

56. What does the placeholder attribute do in an input field?

  • a) It sets a default value
  • b) It adds a label to the input field
  • c) It displays text inside the input field as a hint
  • d) It adds a tooltip to the field
    Answer: c) It displays text inside the input field as a hint

57. What is the correct HTML5 tag for embedding a YouTube video?

  • a) <video>
  • b) <iframe>
  • c) <embed>
  • d) <object>
    Answer: b) <iframe>


58. Which of the following HTML elements is used to define a section in a document?

  • a) <div>
  • b) <section>
  • c) <article>
  • d) <header>
    Answer: b) <section>

59. Which attribute is used to specify an image’s URL in HTML?

  • a) src
  • b) href
  • c) link
  • d) imgsrc
    Answer: a) src

60. What is the correct HTML5 element for playing audio files?

  • a) <music>
  • b) <audio>
  • c) <sound>
  • d) <play>
    Answer: b) <audio>

61. Which attribute is used to specify the language of an HTML document?

  • a) lang
  • b) dir
  • c) langcode
  • d) xml
    Answer: a) lang

62. What is the correct HTML element for defining important text?

  • a) <b>
  • b) <i>
  • c) <important>
  • d) <strong>
    Answer: d) <strong>

63. What is the correct HTML element for emphasizing text?

  • a) <em>
  • b) <i>
  • c) <strong>
  • d) <b>
    Answer: a) <em>

64. Which HTML element is used to define a block of text that is quoted from another source?

  • a) <quote>
  • b) <blockquote>
  • c) <q>
  • d) <cite>
    Answer: b) <blockquote>

65. Which attribute is used in HTML to make text appear in bold?

  • a) <bold>
  • b) <b>
  • c) <strong>
  • d) <bolded>
    Answer: b) <b>

66. Which HTML element is used to define the footer for a document or section?

  • a) <foot>
  • b) <bottom>
  • c) <footer>
  • d) <end>
    Answer: c) <footer>

67. How can you create a hyperlink that opens an email client to send an email?

  • a) <a href="mail:email@example.com">Email Us</a>
  • b) <a href="mailto:email@example.com">Email Us</a>
  • c) <a email="email@example.com">Email Us</a>
  • d) <a href="emailto:email@example.com">Email Us</a>
    Answer: b) <a href="mailto:email@example.com">Email Us</a>

68. What is the purpose of the target="_blank" attribute in an <a> tag?

  • a) To open the linked document in a new tab or window
  • b) To open the linked document in the same frame
  • c) To highlight the link
  • d) To make the link underlined
    Answer: a) To open the linked document in a new tab or window

69. Which HTML element is used to define a client-side image map?

  • a) <map>
  • b) <area>
  • c) <img>
  • d) <coordinates>
    Answer: a) <map>

70. What is the correct way to specify that a form field is required in HTML5?

  • a) required=”true”
  • b) required=”required”
  • c) required
  • d) required=”yes”
    Answer: c) required

71. Which tag is used in HTML to define a table cell?

  • a) <cell>
  • b) <td>
  • c) <th>
  • d) <row>
    Answer: b) <td>

72. Which HTML element is used to specify a header for a document or section?

  • a) <head>
  • b) <header>
  • c) <h1>
  • d) <section>
    Answer: b) <header>

73. What does the autoplay attribute do in HTML5 media elements?

  • a) Starts playing the video or audio file automatically when the page loads
  • b) Loops the media file
  • c) Adds a play button
  • d) Mutes the media file
    Answer: a) Starts playing the video or audio file automatically when the page loads

74. Which element is used to group form elements in HTML?

  • a) <fieldset>
  • b) <formgroup>
  • c) <group>
  • d) <set>
    Answer: a) <fieldset>

75. Which HTML element is used to represent the result of a calculation?

  • a) <output>
  • b) <calc>
  • c) <result>
  • d) <math>
    Answer: a) <output>

76. Which attribute is used to make a form input field non-editable in HTML?

  • a) readonly
  • b) disabled
  • c) noedit
  • d) lock
    Answer: a) readonly

77. Which of the following HTML attributes is used to specify that an input field should automatically get focus when the page loads?

  • a) focus
  • b) autofocus
  • c) active
  • d) loadfocus
    Answer: b) autofocus

78. Which HTML5 element is used to define navigation links?

  • a) <nav>
  • b) <menu>
  • c) <navigate>
  • d) <links>
    Answer: a) <nav>

79. How do you specify the relationship between a document and an external resource in HTML?

  • a) <link>
  • b) <rel>
  • c) <src>
  • d) <href>
    Answer: a) <link>

80. Which element is used to embed external applications in an HTML page?

  • a) <embed>
  • b) <object>
  • c) <iframe>
  • d) <insert>
    Answer: a) <embed>

81. Which HTML tag is used to define a description list?

  • a) <dl>
  • b) <list>
  • c) <desc>
  • d) <ul>
    Answer: a) <dl>

82. Which HTML element is used to display text with a fixed-width font?

  • a) <code>
  • b) <pre>
  • c) <tt>
  • d) <fixed>
    Answer: c) <tt>

83. How do you specify a form’s action attribute in HTML?

  • a) <form method="get">
  • b) <form action="submit.html">
  • c) <form target="action">
  • d) <form post="action.html">
    Answer: b) <form action="submit.html">

84. What is the correct HTML5 tag for creating a search input field?

  • a) <input type="text">
  • b) <input type="search">
  • c) <input type="find">
  • d) <input type="query">
    Answer: b) <input type="search">

85. Which of the following HTML elements is used to display content in a new line without starting a new block?

  • a) <br>
  • b) <div>
  • c) <p>
  • d) <span>
    Answer: d) <span>

86. Which tag is used to define a drop-down option in HTML?

  • a) <opt>
  • b) <select>
  • c) <option>
  • d) <dropdown>
    Answer: c) <option>

87. What is the correct HTML tag for creating a checkable input (checkbox)?

  • a) <input type="checkbox">
  • b) <input type="check">
  • c) <checkbox>
  • d) <check>
    Answer: a) <input type="checkbox">

88. How can you disable a form field in HTML?

  • a) <input type="text" disabled>
  • b) <input type="text" readonly>
  • c) <input type="text" hidden>
  • d) <input type="text" inactive>
    Answer: a) <input type="text" disabled>

89. Which HTML element is used to group table header, body, and footer content?

  • a) <thead>
  • b) <tbody>
  • c) <tfoot>
  • d) <table>
    Answer: d) <table>

90. Which HTML attribute is used to set a default value for a form input field?

  • a) value
  • b) default
  • c) placeholder
  • d) initial
    Answer: a) value

91. Which tag is used to display the directory of a web page in HTML?

  • a) <nav>
  • b) <dir>
  • c) <menu>
  • d) <ul>
    Answer: b) <dir>

92. What is the correct HTML5 element for defining a table body?

  • a) <tablebody>
  • b) <tbody>
  • c) <table>
  • d) <td>
    Answer: b) <tbody>

93. What is the correct way to create a hidden form field in HTML?

  • a) <input type="hidden">
  • b) <input type="invisible">
  • c) <input type="none">
  • d) <input type="hide">
    Answer: a) <input type="hidden">

94. Which tag is used to define the start of a table in HTML?

  • a) <thead>
  • b) <tr>
  • c) <table>
  • d) <tbody>
    Answer: c) <table>

95. What does the for attribute in a <label> tag do in HTML?

  • a) Links the label to a specific input field
  • b) Specifies the type of input field
  • c) Sets the label’s ID
  • d) Specifies the form action
    Answer: a) Links the label to a specific input field

96. How do you specify a placeholder in a password field in HTML?

  • a) <input type="password" placeholder="Enter your password">
  • b) <input type="password" default="Enter your password">
  • c) <input type="password" hint="Enter your password">
  • d) <input type="password" value="Enter your password">
    Answer: a) <input type="password" placeholder="Enter your password">

97. Which tag is used to add a caption to a <figure> element in HTML?

  • a) <caption>
  • b) <title>
  • c) <figcaption>
  • d) <legend>
    Answer: c) <figcaption>

98. Which tag is used to specify a group of media content in HTML?

  • a) <video>
  • b) <audio>
  • c) <media>
  • d) <picture>
    Answer: d) <picture>

99. Which HTML tag is used to define a form control for entering numbers?

  • a) <input type="text">
  • b) <input type="number">
  • c) <input type="range">
  • d) <input type="float">
    Answer: b) <input type="number">

100. What is the correct HTML5 element for creating a progress bar?

  • a) <meter>
  • b) <progress>
  • c) <bar>
  • d) <loading>
b) Progress

10 Tricky & Difficult MCQs

1. Document Type Declaration

What is the correct HTML5 document type declaration?

  • a) <!DOCTYPE html>
  • b) <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  • c) <!DOCTYPE html5>
  • d) <!DOCTYPE XHTML 1.0 Strict>
    Answer: a) <!DOCTYPE html>

2. Character Entities

Which of the following character entities represents the less-than symbol (<)?

  • a) &lt;
  • b) &less;
  • c) &lt>
  • d) &low;
    Answer: a) &lt;

3. Global Attributes

Which of the following attributes is NOT a global attribute in HTML?

  • a) class
  • b) style
  • c) contenteditable
  • d) src
    Answer: d) src

4. Accessibility Attributes

Which of the following attributes is used to improve accessibility by providing a description for screen readers?

  • a) role
  • b) aria-label
  • c) title
  • d) data-*
    Answer: b) aria-label

5. Form Submission Method

What is the default method of form submission in HTML if no method attribute is specified?

  • a) GET
  • b) POST
  • c) PUT
  • d) DELETE
    Answer: a) GET

6. HTML5 Features

Which of the following elements is introduced in HTML5 for semantic purposes?

  • a) <header>
  • b) <section>
  • c) <footer>
  • d) All of the above
    Answer: d) All of the above

7. Reserved Keywords

Which of the following is a reserved keyword in HTML and cannot be used as an ID or class name?

  • a) header
  • b) footer
  • c) main
  • d) body
    Answer: d) body

8. Deprecated Attributes

Which of the following attributes is deprecated in HTML5 for the <table> element?

  • a) cellpadding
  • b) border
  • c) width
  • d) summary
    Answer: d) summary

9. Meta Tags

Which <meta> tag is used to specify the character encoding for an HTML document?

  • a) <meta charset="UTF-8">
  • b) <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  • c) Both a and b
  • d) <meta name="encoding" content="UTF-8">
    Answer: c) Both a and b

10. Data Attributes and JavaScript

How can you access a data attribute value in JavaScript if an element has the attribute data-role="admin"?

  • a) element.getAttribute("data-role")
  • b) element.data-role
  • c) element.dataset.role
  • d) Both a and c
    Answer: d) Both a and c

Dont forget to visit iconixinfo for more

Leave a Comment

Your email address will not be published. Required fields are marked *