Learn HTML MCQs

Prepare HTML MCQs (Multiple choice Questions) for exam and job interviews.

What is the correct HTML element for a line break?

1) <br>

2) <break>

3) <lb>

4) <newline>

Answer : <br>

Which HTML tag is used for a clickable button?

1) <button>

2) <click>

3) <input type="button">

4) <btn>

Answer : <button>

How do you add a background color in CSS?

1) background-color: red;

2) bgcolor: red;

3) color: red;

4) background: red;

Answer : background-color: red;

What does the `<span>` tag do in HTML?

1) Defines a section

2) Styles text

3) Groups inline elements

4) Creates a paragraph

Answer : Groups inline elements

Which attribute is used to specify an image map?

1) src

2) usemap

3) map

4) link

Answer : usemap

What is the purpose of the `<iframe>` tag?

1) Embed another document

2) Link to a file

3) Insert an image

4) Create a frame

Answer : Embed another document

How do you create a drop-down list in HTML?

1) <select>

2) <list>

3) <dropdown>

4) <options>

Answer : <select>

What does the `alt` attribute do for an image?

1) Provides alternative text

2) Links to another page

3) Defines the image size

4) Styles the image

Answer : Provides alternative text

What is the correct way to link a CSS file?

1) <link rel="stylesheet" href="style.css">

2) <css href="style.css">

3) <link src="style.css">

4) <stylesheet href="style.css">

Answer : <link rel="stylesheet" href="style.css">

Which tag is used to define a section in a document?

1) <section>

2) <div>

3) <article>

4) <group>

Answer : <section>