MCQ Related to HTML

  1. What does HTML stand for?
    • a) Hyper Text Markup Language
    • b) Hyperlinks and Text Markup Language
    • c) High Text Markup Language
    • d) High-Level Text Markup Language
  2. Which tag is used to create a hyperlink in HTML?
    • a) <link>
    • b) <a>
    • c) <href>
    • d) <url>
  3. Which of the following is a block-level element?
    • a) <span>
    • b) <div>
    • c) <a>
    • d) <img>
  4. What is the correct HTML for adding a background color?
    • a) <body bg="yellow">
    • b) <background>yellow</background>
    • c) <body style="background-color:yellow;">
    • d) <body color="yellow">
  5. Which HTML attribute specifies an alternate text for an image, if the image cannot be displayed?
    • a) src
    • b) alt
    • c) title
    • d) longdesc
  6. Which tag is used to define an unordered list?
    • a) <ol>
    • b) <ul>
    • c) <li>
    • d) <list>
  7. What is the correct HTML for inserting an image?
    • a) <img src="url" alt="description">
    • b) <image src="url" alt="description">
    • c) <img href="url" alt="description">
    • d) <img link="url" alt="description">
  8. Which tag is used to create an HTML table?
    • a) <table>
    • b) <tab>
    • c) <tr>
    • d) <td>
  9. Which tag is used to define a footer for a document or section?
    • a) <footer>
    • b) <bottom>
    • c) <section>
    • d) <foot>
  10. What is the function of the <head> tag in HTML?
    • a) To display the title of the document
    • b) To contain metadata and links to CSS/JS files
    • c) To define the main content
    • d) Both a and b
  11. Which of the following elements is used to create a form in HTML?
    • a) <input>
    • b) <form>
    • c) <submit>
    • d) Both a and b
  12. How do you create a checkbox in HTML?
    • a) <checkbox>
    • b) <input type="checkbox">
    • c) <input checkbox>
    • d) <check>
  13. Which HTML element is used to define navigation links?
    • a) <nav>
    • b) <links>
    • c) <navigation>
    • d) <menu>
  14. What is the correct HTML syntax for creating a text area?
    • a) <textarea>
    • b) <textArea>
    • c) <input type="textarea">
    • d) Both a and b
  15. What does the <title> tag define in HTML?
    • a) The content of the page
    • b) The title of the document shown in the browser’s title bar
    • c) A title for a section
    • d) None of the above
  16. Which of the following is a valid HTML5 doctype?
    • a) <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    • b) <!DOCTYPE html>
    • c) <!DOCTYPE HTML5>
    • d) <!DOCTYPE HTML 5.0>
  17. Which tag is used to define a list item?
    • a) <li>
    • b) <item>
    • c) <list>
    • d) <listitem>
  18. How do you define a line break in HTML?
    • a) <break>
    • b) <br>
    • c) <newline>
    • d) <line>
  19. Which attribute is used to specify the character set in HTML?
    • a) charset
    • b) type
    • c) content
    • d) lang
  20. What is the purpose of the <meta> tag in HTML?
    • a) Provide metadata about the HTML document
    • b) Create links to other documents
    • c) Define the main content
    • d) None of the above
  21. How can you create a numbered list in HTML?
    • a) <ol>
    • b) <ul>
    • c) <dl>
    • d) <list>
  22. Which tag is used to display a horizontal line in HTML?
    • a) <line>
    • b) <hr>
    • c) <rule>
    • d) <hline>
  23. What is the correct HTML for adding a comment?
    • a) <!-- comment -->
    • b) /* comment */
    • c) // comment
    • d) <comment>
  24. What is the purpose of the <script> tag in HTML?
    • a) To include CSS styles
    • b) To include JavaScript code
    • c) To define sections of content
    • d) Both a and b
  25. What does the href attribute do in an anchor tag?
    • a) Defines the link text
    • b) Specifies the URL of the page the link goes to
    • c) Sets the target of the link
    • d) None of the above
  26. How can you make a numbered list in HTML?
    • a) <list>
    • b) <ol>
    • c) <ul>
    • d) <dl>
  27. Which HTML element is used to define the document type?
    • a) <doctype>
    • b) <DOCTYPE>
    • c) <html>
    • d) <head>
  28. What is the purpose of the <link> element?
    • a) Create links to other HTML documents
    • b) Link to external CSS files
    • c) Define navigation links
    • d) None of the above
  29. What tag is used to define a table header?
    • a) <th>
    • b) <thead>
    • c) <header>
    • d) <theader>
  30. Which of the following is required in a form element?
    • a) <input>
    • b) <submit>
    • c) <action>
    • d) <form> itself
  31. How do you create a text input field in HTML?
    • a) <input type="text">
    • b) <textinput>
    • c) <input field="text">
    • d) <textbox>
  32. Which attribute is used to specify the URL for a link?
    • a) src
    • b) href
    • c) url
    • d) link
  33. Which HTML element is used to add an audio file?
    • a) <audio>
    • b) <sound>
    • c) <music>
    • d) <mp3>
  34. How do you create a dropdown list in HTML?
    • a) <input type="dropdown">
    • b) <select>
    • c) <listbox>
    • d) <dropdown>
  35. Which HTML element is used to create a section in a document?
    • a) <section>
    • b) <div>
    • c) <article>
    • d) All of the above
  36. What is the purpose of the <style> tag in HTML?
    • a) To embed CSS styles
    • b) To define HTML elements
    • c) To include JavaScript files
    • d) None of the above
  37. What type of element is <input type="radio">?
    • a) Button
    • b) Checkable
    • c) Selectable
    • d) None of the above
  38. How do you define a heading in HTML?
    • a) <heading>
    • b) <h1> to <h6>
    • c) <title>
    • d) <header>
  39. What attribute do you use to specify an inline CSS style in HTML?
    • a) style
    • b) css
    • c) design
    • d) class
  40. Which of the following elements is used for an inline CSS style?
    • a) <style>
    • b) <script>
    • c) style attribute
    • d) Both a and c
  41. What does the <canvas> element do in HTML?
    • a) Draw graphics on the web page
    • b) Define a container for images
    • c) Embeds videos
    • d) Create forms
  42. How do you define a link that opens in a new tab?
    • a) <a href="url" target="_blank">
    • b) <a href="url" newtab>
    • c) <a href="url" target="new">
    • d) <a link="url" newtab>
  43. What HTML element is used to embed a video file?
    • a) <movie>
    • b) <video>
    • c) <media>
    • d) <film>
  44. What does the target attribute do in a link?
    • a) Specifies the frame where the link will open
    • b) Defines a character set
    • c) Sets the type of link
    • d) None of the above
  45. Which tag is used to define a description list?
    • a) <dl>
    • b) <list>
    • c) <desclist>
    • d) <description>
  46. What is used to create a clickable button in HTML?
    • a) <button>
    • b) <input type="button">
    • c) Both a and b
    • d) <clickable>
  47. How do you add a title to a document in HTML?
    • a) Through the <head> section
    • b) Using the <title> tag
    • c) Both a and b
    • d) In the <body> section
  48. What type of element is <form>?
    • a) Block-level
    • b) Inline
    • c) Self-closing
    • d) None of the above
  49. Which attribute of the <img> tag specifies the image source?
    • a) src
    • b) srcfile
    • c) link
    • d) image
  50. What tag is used to define a division or section in an HTML document?
    • a) <div>
    • b) <section>
    • c) <block>
    • d) <group>