Learn HTML MCQs
Prepare HTML MCQs (Multiple choice Questions) for exam and job interviews.
What is the correct HTML element for adding styles to a webpage?
1) <style>
2) <css>
3) <link>
4) <meta>
Answer : <style>
Which HTML element is used to define a container for flow content?
1) <div>
2) <span>
3) <section>
4) <article>
Answer : <div>
How do you create a footer in HTML?
1) <footer>
2) <bottom>
3) <section>
4) <end>
Answer : <footer>
Which HTML tag is used to define a section that is independent from the rest of the document?
1) <section>
2) <div>
3) <article>
4) <aside>
Answer : <article>
What does the `placeholder` attribute do in an `<input>` field?
1) Sets a default value
2) Displays a hint in the input field
3) Specifies the size of the input
4) Defines the type of input
Answer : Displays a hint in the input field
Which HTML element is used to specify a group of related options in a dropdown?
1) <select>
2) <optgroup>
3) <dropdown>
4) <option>
Answer : <optgroup>
What is the correct HTML tag for inserting a line break?
1) <break>
2) <br>
3) <lb>
4) <linebreak>
Answer : <br>
Which HTML tag is used for creating a dropdown list?
1) <list>
2) <select>
3) <dropdown>
4) <combo>
Answer : <select>
What is the purpose of the `<meta>` tag in HTML?
1) To create a header
2) To link CSS
3) To define metadata
4) To embed scripts
Answer : To define metadata
Which attribute is used to specify the URL of the page the link goes to in an `<a>` tag?
1) url
2) link
3) source
4) href
Answer : href