html mcq questions for class 8 with answers

In this HTML MCQ Test, you will find all the important questions that are commonly asked in Class 8 exams. This test will help you score good marks in your paper. After completing the test, you will be able to see the correct and incorrect answers for all questions, and their solutions will also be explained.

Q1. Our webpage has five h2 tags. We want to set the background color of four h2 tags to yellow. Which selector is the best for this?

class selector
id selector
tag selector
child selector
✅ Correct Answer: class selector

When we want to apply the same style to multiple elements, we use a class selector.

Q2. h1, h2, p { color:red; } Which selector is used in the given CSS code?

group selector
id selector
class selector
none of these
✅ Correct Answer: group selector

In CSS, a group selector is used to select multiple elements at the same time.

Q3. How many heading tags are there in HTML?

4
6
8
10
✅ Correct Answer: 6

There are 6 heading tags in HTML. They start from <h1> and go up to <h6>.

Q4. Identify the paragraph tag from the following.

<paragrap>
<pre>
<p>
<para>
✅ Correct Answer: <p>

In HTML, the <p> tag is used to create a paragraph.

Q5. The <ul> tag is used to create which type of list?

Ordered list
Unordered list
Description list
All of these
✅ Correct Answer: Unordered list

The <ul> tag is used to create an unordered list. In this list, all items are displayed with bullet points.

Q6. Identify the correct tag used to add an anchor tag on a webpage.

<link>
<anchor>
<a>
<an>
✅ Correct Answer: <a>

The <a> tag is used to create an anchor (link) on a webpage. It allows us to move from one page to another easily.

Q7. What is HTML used for?

To create photos
To create software
To create web pages
None of these
✅ Correct Answer: To create web pages

HTML is used to create web pages. It defines the structure of a webpage.

Q8. Which tag is used to create a table row in HTML?

<table>
<td>
<th>
<tr>
✅ Correct Answer: <tr>

In HTML, the <tr> tag is used to create a table row.

Q9. Which tag is used to add an image on a webpage?

<image>
<img>
<im>
<src>
✅ Correct Answer: <img>

The <img> tag is used to add an image to a webpage. The link of the image is given in the src attribute.

Q10. Why are forms used in HTML?

To take data from users
To give data
To display images
To create lists
✅ Correct Answer: To take data from users

HTML forms are used when we need to collect data from users.