HTML MCQs - Fundamentals-2

1. The correct sequence of HTML tags for starting a webpage is -
a) Head, Title, HTML, body
b) HTML, Body, Title, Head
c) HTML, Head, Title, Body
d) HTML, Head, Body, Title

Answer: c
Explanation: The correct sequence of HTML tags to start a webpage is html, head, title, and body.

2. How to insert an image in HTML?
a) <img href = "jtp.png" />
b) <img url = "jtp.png" />
c) <img link = "jtp.png" />
d) <img src = "jtp.png" />

Answer: d
Explanation: The img tag and the src attribute is used to display an image on the webpage.

3. The tags in HTML are -
a) case-sensitive
b) in upper case
c) not case sensitive
d) in lowercase

Answer: c
Explanation: HTML is a case-insensitive language, which means we can use tags either in the upper-case or in lower-case. It is recommended to write all tags in the lowercase for readability, consistency, etc.

4. HTML tags are enclosed in-
a) # and #
b) { and }
c) ! and ?
d) < and >

Answer: d
Explanation: All HTML tags must be enclosed within angular < > brackets.

5. How to create an unordered list (a list with the list items in bullets) in HTML?
a) <ul>
b) <ol>
c) <li>
d) <i>

Answer: a
Explanation: The <ul> tag in HTML is used to display the list items in a bulleted format. There can be four types of an unordered list: disc, circle, square, and none.

6. How to create a checkbox in HTML?
a) <input type = "checkbox">
b) <input type = "button">
c) <checkbox>
d) <input type = "check">

Answer: a
Explanation: To create a checkbox in HTML, we have to use the <input> tag and give the value checkbox to its type attribute.

7. What will the browser display for the above HTML code?
<a href="home.php">Go to Home Page</a>
a) It will display the entire line as it is.
b) It will display- Go to Home Page
c) It will display- Go to Home Page(link)
d) First it will display home.php, and upon clicking it, it will display Go to Home Page.(link)

Answer: c
Explanation: It creates a link as Go to Home Page, upon clicking of which if redirects to home.php page.

8. Which of the following tag is used to add rows in the table?
a) <td>and</td>
b) <th>and</th>
c) <tr>and</tr>
d) None of the above

Answer: c
Explanation: The <tr> tag in HTML is used to define the rows in the table. It can consist one or more <th> head cells and <td> data cells to define a single row of HTML table.

9. Choose the correct option.
a) destination address is specified as value of href between and tag.
b) address specified as value of href in HTML have to be absolute.
c) address specified as value of href in HTML have to be relative.
d) address specified as value of href in HTML can be absolute or relative.

Answer: d
Explanation: The address is specified as the value of href inside <a> tag of HTML and it can be either absolute or relative.

10. Which one of the following can be used to define the spacing between the cells of a table?
a) border-spacing
b) spacing
c) cell-spacing
d) table-spacing

Answer: a
Explanation: By setting the value of border-spacing, we can adjust the spacing between the cells of a table.