Learn HTML MCQs
Prepare HTML MCQs (Multiple choice Questions) for exam and job interviews.
What does the `<section>` tag do in HTML?
1) Creates a header
2) Defines a navigation
3) Defines a section of a document
4) Adds a footer
Answer : Defines a section of a document
What is the purpose of the `<link>` tag in HTML?
1) To link to CSS files
2) To create links
3) To define metadata
4) To embed scripts
Answer : To link to CSS files
Which attribute is used to specify the relationship between the current document and the linked document?
1) rel
2) link
3) href
4) type
Answer : rel
Which HTML tag is used for creating a table?
1) <table>
2) <tbl>
3) <tab>
4) <tabledata>
Answer : <table>
What is the correct HTML for creating an ordered list?
1) <ol><li>Item 1</li></ol>
2) <ul><li>Item 1</li></ul>
3) <list><item>Item 1</item></list>
4) <ol>Item 1</ol>
Answer : <ol><li>Item 1</li></ol>
How do you create a text area in HTML?
1) <textarea>
2) <input type="textarea">
3) <text>
4) <field>
Answer : <textarea>
Which HTML element is used to define an internal style sheet?
1) <style>
2) <css>
3) <script>
4) <header>
Answer : <style>
What is the correct HTML for adding a background color?
1) <background color="red">
2) <body style="background-color: red;">
3) <bgcolor="red">
4) <body background="red">
Answer : <body style="background-color: red;">
Which tag is used to define the header for a document or section?
1) <head>
2) <header>
3) <h1>
4) <section>
Answer : <header>
How can you create a comment in HTML?
1) <!-- This is a comment -->
2) <comment>This is a comment</comment>
3) <# This is a comment #>
4) <-- This is a comment
Answer : <!-- This is a comment -->