0
0
HTMLmarkup~20 mins

Title attribute in HTML - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Title Attribute Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
What does the title attribute do in HTML?
Choose the correct description of the title attribute's purpose in HTML elements.
AIt adds a clickable link to the element.
BIt changes the font size of the element's text.
CIt defines the main heading of the webpage.
DIt provides extra information shown as a tooltip when the user hovers over the element.
Attempts:
2 left
💡 Hint
Think about what happens when you move your mouse over a word or image on a webpage.
📝 Syntax
intermediate
2: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">
A<img src="kitten.jpg" alt="Kitten" tooltip="Cute kitten">
B<img src="kitten.jpg" alt="Kitten" title="Cute kitten">
C<img src="kitten.jpg" alt="Kitten" hover="Cute kitten">
D<img src="kitten.jpg" alt="Kitten" title=''>
Attempts:
2 left
💡 Hint
The attribute name is exactly 'title' and the value is inside quotes.
rendering
advanced
2: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>
AA small popup tooltip showing 'Greeting message' appears on hover.
BNothing happens when hovering over 'Hello'.
CThe word 'Hello' changes color on hover.
DThe text 'Greeting message' replaces 'Hello' on hover.
Attempts:
2 left
💡 Hint
The title attribute triggers a tooltip on hover.
accessibility
advanced
2:00remaining
How does the title attribute affect accessibility?
Which statement about the title attribute and screen readers is true?
ASome screen readers may read the <code>title</code> attribute, but it should not replace proper labels.
BScreen readers never read the <code>title</code> attribute, so it has no accessibility impact.
CScreen readers always read the <code>title</code> attribute aloud when focusing on the element.
DThe <code>title</code> attribute automatically improves keyboard navigation.
Attempts:
2 left
💡 Hint
Think about how screen readers handle extra info and the importance of clear labels.
selector
expert
2: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.
A[title]
B[title=""]
C[title]:not([title=""])
D:has([title])
Attempts:
2 left
💡 Hint
Think about how to exclude empty attribute values using CSS selectors.