HTML Questions

P
Pooja Arya
Score: 🔥 46
Beginner
Took 2 months
Programming Language
HTML
80%
Questions Attempted
14 / 15
Correct Answers
12
Incorrect Answers
3
Points Earned
🔥 12

Question 1

What does the 'alt' attribute provide for an image in HTML?

Explanation:

The alt attribute provides alternative text that is displayed if the image cannot be loaded. It's crucial for accessibility and SEO purposes.

Question 2

Which HTML tag is used to define a paragraph?

Explanation:

The <p> tag defines a paragraph in HTML. Browsers automatically add some space (a margin) before and after each <p> element.

Question 3

In which scenario would you use the <aside> tag?

Explanation:

The <aside> tag is intended for content that is indirectly related to the main content, such as sidebars, pull quotes, or glossaries.

Question 4

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

Explanation:

The <br> tag inserts a simple line break in HTML. There's no need for a closing tag; it's a self-closing tag.

Question 5

Which attribute is used to merge rows vertically in an HTML table?

Explanation:

The rowspan attribute specifies how many rows a table cell should span vertically. It allows a single cell to occupy space across multiple rows.

Question 6

What character is represented by the HTML entity &?

Explanation:

The & entity represents the ampersand symbol itself. This is because the ampersand is used to denote the start of an HTML entity.

Question 7

Which of the following RGBA values represents a fully opaque blue color?

Explanation:

In RGBA, an alpha value of 1 represents full opacity. Therefore, rgba(0, 0, 255, 1) gives a fully opaque blue color.

Question 8

What is the purpose of a 'textarea' element in a form?

Explanation:

Unlike a single-line text input, the <textarea> element provides a larger area for users to enter multiple lines of text.

Question 9

Which tag is used to create a numbered list?

Explanation:

'<ol>' stands for ordered list and is used for numbered lists. '<ul>' creates unordered (bulleted) lists.

Question 10

How can you create a clickable image that acts as a hyperlink in HTML?

Explanation:

To make an image clickable, you need to wrap the <img> tag within an <a> tag. The href attribute of the <a> tag will determine the link destination.

Question 11

How do you create a nested list in HTML?

Explanation:

To nest lists, simply place one list element (like <ul> or <ol>) inside another list element. This will visually create a nested list structure.

Question 12

Which tag is used to embed an image in an HTML document?

Explanation:

The <img> tag is the primary way to insert images into an HTML document. It's a self-closing tag, meaning it doesn't require a closing tag.

Question 13

What is the correct way to specify the color 'blue' using an HTML color name?

Explanation:

While all options might visually achieve a blue color, the most current and recommended way is using inline styles: <p style="color: blue;">. Using <font> tag is outdated and <body bgcolor> is also not the preferred method.

Question 14

Which file format is NOT commonly used for favicons?

Explanation:

Favicons are image files, and '.txt' is a plain text file format. The common formats for favicons are .ico, .png, and sometimes .jpg.