Challenge - 5 Problems
Title Attribute Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate2:00remaining
What does the
title attribute do in HTML?Choose the correct description of the
title attribute's purpose in HTML elements.Attempts:
2 left
💡 Hint
Think about what happens when you move your mouse over a word or image on a webpage.
✗ Incorrect
The
title attribute adds a small popup text (tooltip) that appears when the mouse pointer hovers over the element. It does not affect styling or linking.📝 Syntax
intermediate2:00remaining
Identify the correct use of the
title attribute in this HTML snippet.Which option correctly adds a
title attribute to the <img> tag to show 'Cute kitten' on hover?HTML
<img src="kitten.jpg" alt="Kitten">
Attempts:
2 left
💡 Hint
The attribute name is exactly 'title' and the value is inside quotes.
✗ Incorrect
Only option B uses the correct attribute name 'title' with the meaningful string 'Cute kitten'. Option B has an empty value, and B and C use invalid attribute names.
❓ rendering
advanced2:00remaining
What is the visible effect of this HTML code in a browser?
Given the code below, what will the user see when they hover the mouse over the word 'Hello'?
HTML
<p title="Greeting message">Hello</p>
Attempts:
2 left
💡 Hint
The
title attribute triggers a tooltip on hover.✗ Incorrect
The
title attribute causes a tooltip with its value to appear when the user hovers over the element.❓ accessibility
advanced2:00remaining
How does the
title attribute affect accessibility?Which statement about the
title attribute and screen readers is true?Attempts:
2 left
💡 Hint
Think about how screen readers handle extra info and the importance of clear labels.
✗ Incorrect
The
title attribute can be read by some screen readers but is inconsistent. It should not replace clear, visible labels for accessibility.❓ selector
expert2:00remaining
Which CSS selector targets all elements with a non-empty
title attribute?Choose the CSS selector that selects only elements that have a
title attribute with at least one character.Attempts:
2 left
💡 Hint
Think about how to exclude empty attribute values using CSS selectors.
✗ Incorrect
Option C selects elements with a title attribute that is not empty. Option C selects all with title, including empty. Option C selects only empty titles. Option C is invalid CSS syntax.