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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.