Test Your HTML Knowledge: 50 MCQs with Answers

50+ HTML MCQs with Answers (2023)

Which of the following tags is used to create an image in HTML?

  • a. <img>
  • b. <a>
  • c. <p>
  • d. <div>

Answer: a. <img>

Which attribute is used to specify the URL of the image in the <img> tag?

  • a. href
  • b. src
  • c. alt
  • d. title

Answer: b. src

Which of the following tags is used to create a hyperlink in HTML?

  • a. <a>
  • b. <img>
  • c. <p>
  • d. <div>

Answer: a. <a>

Which attribute is used to specify the URL that the hyperlink points to in the <a> tag?

  • a. href
  • b. src
  • c. alt
  • d. title

Answer: a. href

Which of the following tags is used to create a table in HTML?

  • a. <table>
  • b. <tr>
  • c. <td>
  • d. All of the above

Answer: d. All of the above

Which attribute is used to specify the number of columns in a table in the <table> tag?

  • a. rows
  • b. cols
  • c. span
  • d. colspan

Answer: b. cols

Which of the following tags is used to create a list in HTML?

  • a. <ol>
  • b. <ul>
  • c. <li>
  • d. All of the above

Answer: d. All of the above

Which attribute is used to specify the type of list in the <ol> tag?

  • a. type
  • b. value
  • c. start
  • d. None of the above

Answer: a. type

Which of the following tags is used to create a form in HTML?

  • a. <form>
  • b. <input>
  • c. <button>
  • d. <label>

Answer: a. <form>

Which attribute is used to specify the method of submitting a form in the <form> tag?

  • a. method
  • b. action
  • c. type
  • d. None of the above

Answer: a. method

Which tag is used to define the main heading of a page in HTML5?

  • a. <h1>
  • b. <header>
  • c. <title>
  • d. <head>

Answer: a. <h1>

Which of the following tags is used to add a line break in HTML?

  • a. <br>
  • b. <hr>
  • c. <p>
  • d. <div>

Answer: a. <br>

Which attribute is used to specify the text that appears when you hover over an image in the <img> tag?

  • a. href
  • b. src
  • c. alt
  • d. title

Answer: d. title

Which of the following tags is used to create an unordered list in HTML?

  • a. <ol>
  • b. <ul>
  • c. <li>
  • d. <dl>

Answer: b. <ul>

Which attribute is used to specify the color of text in HTML?

  • a. bgcolor
  • b. color
  • c. text
  • d. None of the above

Answer: b. color

Which tag is used to add a comment in HTML?

  • a. <comment>
  • b. <!– –>
  • c. <meta>
  • d. <html>

Answer: b. <!– –>

Which of the following tags is used to create a checkbox in HTML?

  • a. <input type=”checkbox”>
  • b. <input type=”radio”>
  • c. <select>
  • d. <textarea>

Answer: a. <input type=”checkbox”>

Which attribute is used to specify the size of the font in HTML?

  • a. font-size
  • b. size
  • c. text-size
  • d. None of the above

Answer: a. font-size

Which of the following tags is used to create a line across the page in HTML?

  • a. <br>
  • b. <hr>
  • c. <p>
  • d. <div>

Answer: b. <hr>

Which attribute is used to specify the width of a table border in HTML?

  • a. border-width
  • b. table-width
  • c. border-size
  • d. None of the above

Answer: a. border-width

Which tag is used to define the body of an HTML document?

  • a. <head>
  • b. <body>
  • c. <html>
  • d. <title>

Answer: b. <body>

Which attribute is used to specify the width of an image in the <img> tag?

  • a. width
  • b. height
  • c. size
  • d. scale

Answer: a. width

Which of the following tags is used to create a dropdown list in HTML?

  • a. <select>
  • b. <input type=”dropdown”>
  • c. <option>
  • d. <ul>

Answer: a. <select>

Which attribute is used to specify the target window or frame for a hyperlink in the <a> tag?

  • a. href
  • b. src
  • c. target
  • d. title

Answer: c. target

Which of the following tags is used to create a paragraph in HTML?

  • a. <p>
  • b. <br>
  • c. <div>
  • d. <hr>

Answer: a. <p>

Which attribute is used to specify the alignment of an image in the <img> tag?

  • a. align
  • b. position
  • c. center
  • d. margin

Answer: a. align

Which of the following tags is used to create a bold text in HTML?

  • a. <b>
  • b. <i>
  • c. <u>
  • d. <strong>

Answer: a. <b>

Which attribute is used to specify the maximum number of characters allowed in a text input field in HTML?

  • a. maxlength
  • b. size
  • c. length
  • d. None of the above

Answer: a. maxlength

Which of the following tags is used to create a radio button in HTML?

  • a. <input type=”checkbox”>
  • b. <input type=”radio”>
  • c. <select>
  • d. <textarea>

Answer: b. <input type=”radio”>

Which attribute is used to specify the background color of an HTML element?

  • a. background
  • b. bgcolor
  • c. color
  • d. None of the above

Answer: b. bgcolor

Which of the following tags is used to create a link to an external stylesheet in HTML?

  • a. <link>
  • b. <style>
  • c. <head>
  • d. <meta>

Answer: a. <link>

Which attribute is used to specify the type of input field in the <input> tag?

  • a. type
  • b. name
  • c. value
  • d. None of the above

Answer: a. type

Which of the following tags is used to create a subscript text in HTML?

  • a. <sub>
  • b. <sup>
  • c. <small>
  • d. <span>

Answer: a. <sub>

Which attribute is used to specify the border color of an HTML element?

  • a. border
  • b. border-color
  • c. color
  • d. None of the above

Answer: b. border-color

Which of the following tags is used to create a video in HTML5?

  • a. <video>
  • b. <audio>
  • c. <object>
  • d. <embed>

Answer: a. <video>

Which attribute is used to specify the MIME type of an external resource in the <link> tag?

  • a. href
  • b. type
  • c. rel
  • d. media

Answer: b. type

Which of the following tags is used to create a horizontal rule in HTML?

  • a. <br>
  • b. <hr>
  • c. <p>
  • d. <div>

Answer: b. <hr>

Which of the following tags is used to create an unordered list in HTML?

  • a. <ol>
  • b. <li>
  • c. <ul>
  • d. <dl>

Answer: c. <ul>

Which attribute is used to specify the height of a table row in HTML?

  • a. rowspan
  • b. colspan
  • c. height
  • d. width

Answer: c. height

Which of the following tags is used to create a hyperlink in HTML?

  • a. <a>
  • b. <link>
  • c. <href>
  • d. <url>

Answer: a. <a>

Which attribute is used to specify the location of an image in the <img> tag?

  • a. href
  • b. src
  • c. alt
  • d. title

Answer: b. src

Which of the following tags is used to create a text input field in HTML?

  • a. <input type=”text”>
  • b. <textarea>
  • c. <input type=”button”>
  • d. <input type=”submit”>

Answer: a. <input type=”text”>

Which attribute is used to specify the language of the content in an HTML document?

  • a. lang
  • b. xml:lang
  • c. charset
  • d. None of the above

Answer: a. lang

Which of the following tags is used to create a heading in HTML?

  • a. <header>
  • b. <h1>
  • c. <nav>
  • d. <section>

Answer: b. <h1>

Which attribute is used to specify the size of a font in HTML?

  • a. size
  • b. font-size
  • c. style
  • d. None of the above

Answer: b. font-size

Which of the following tags is used to create an ordered list in HTML?

  • a. <ol>
  • b. <li>
  • c. <ul>
  • d. <dl>

Answer: a. <ol>

Which attribute is used to specify the border width of an HTML element?

  • a. border
  • b. border-width
  • c. width
  • d. None of the above

Answer: b. border-width

Which of the following tags is used to create a line break in HTML?

  • a. <br>
  • b. <hr>
  • c. <p>
  • d. <div>

Answer: a. <br>

Which attribute is used to specify the alignment of a table cell in HTML?

  • a. align
  • b. valign
  • c. colspan
  • d. rowspan

Answer: a. align

There are several benefits of practicing HTML MCQs with Answers:

  1. Enhances knowledge retention: MCQs help reinforce knowledge and concepts learned in HTML by requiring recall and application of information.
  2. Improves time management: Practicing MCQs helps in improving time management skills as one must answer the questions within a given time frame.
  3. Identifies knowledge gaps: MCQs can help identify gaps in understanding of HTML topics. By reviewing incorrect answers, one can identify areas where they need to focus more on.
  4. Increases confidence: Regular practice of MCQs can increase confidence in one’s knowledge and abilities in HTML.
  5. Prepares for exams: MCQs are commonly used in exams, so practicing them can help prepare for HTML exams.
  6. Facilitates revision: MCQs cover a wide range of topics and can be used as a revision tool to refresh HTML concepts and knowledge.
5/5 (2)

Similar Posts