Learn HTML MCQs

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

What does the `<blockquote>` tag do?

1) Defines a section that is quoted from another source

2) Creates a block of text

3) Styles text

4) Indents text

Answer : Defines a section that is quoted from another source

Which tag is used for creating a hyperlink?

1) <link>

2) <a>

3) <url>

4) <href>

Answer : <a>

What does the `<code>` tag represent in HTML?

1) Defines code snippets

2) Defines programming text

3) Creates a block of code

4) Styles text

Answer : Defines code snippets

What attribute is used to provide a unique identifier for an element?

1) class

2) id

3) name

4) value

Answer : id

Which HTML element is used to define the main content of a webpage?

1) <main>

2) <content>

3) <section>

4) <body>

Answer : <main>

What is the correct HTML for creating a checkbox?

1) <input type="checkbox">

2) <checkbox>

3) <input type="check">

4) <input type="box">

Answer : <input type="checkbox">

Which attribute specifies the URL of the page the link goes to?

1) src

2) href

3) link

4) url

Answer : href

What does the `<hr>` tag do?

1) Defines a horizontal line

2) Creates a header

3) Inserts a space

4) Links to another page

Answer : Defines a horizontal line

Which HTML element is used to define a navigation menu?

1) <menu>

2) <nav>

3) <list>

4) <section>

Answer : <nav>

What is the correct way to add a background image in CSS?

1) background-image: url("image.jpg");

2) background: "image.jpg";

3) background-image: "image.jpg";

4) bg-image: url("image.jpg");

Answer : background-image: url("image.jpg");