Learn HTML MCQs

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

Which attribute is used to uniquely identify an HTML element?

1) id

2) class

3) name

4) type

Answer : id

What is the correct HTML element for inserting a line break?

1) <br>

2) <break>

3) <lb>

4) <hr>

Answer : <br>

Which HTML attribute is used to define inline styles?

1) style

2) class

3) id

4) css

Answer : style

How do you specify the language of an HTML document?

1) <html lang="en">

2) <meta lang="en">

3) <language="en">

4) <meta charset="en">

Answer : <html lang="en">

What does the `<a>` tag in HTML define?

1) Anchor link

2) Form link

3) Hypertext link

4) Clickable text

Answer : Anchor link

Which attribute in HTML is used to define an image source?

1) src

2) alt

3) href

4) source

Answer : src

Which HTML tag is used to define an unordered list?

1) <ul>

2) <ol>

3) <li>

4) <list>

Answer : <ul>

Which tag is used to define a table row in HTML?

1) <tr>

2) <td>

3) <table>

4) <th>

Answer : <tr>

Which tag is used to add a header in a table?

1) <th>

2) <thead>

3) <tr>

4) <td>

Answer : <th>

How can you make a numbered list in HTML?

1) <ol>

2) <ul>

3) <li>

4) <dl>

Answer : <ol>