0
0
HTMLmarkup~5 mins

Title attribute in HTML - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is the purpose of the title attribute in HTML?
The title attribute provides additional information about an element. When a user hovers over the element, a small tooltip with this information appears.
Click to reveal answer
beginner
Which HTML elements can have a title attribute?
Almost all HTML elements can have a title attribute, including <a>, <img>, <button>, and <div>.
Click to reveal answer
intermediate
How does the title attribute improve accessibility?
Screen readers can read the title attribute to provide extra context to users who rely on audio, helping them understand the purpose of elements better.
Click to reveal answer
beginner
Example: What will the user see when hovering over this link?<br>
<a href="https://example.com" title="Go to example website">Example</a>
When the user moves the mouse over the link text "Example," a small tooltip will appear showing the text "Go to example website."
Click to reveal answer
intermediate
True or False: The title attribute should be used as the only way to provide important information.
False. The title attribute is helpful but should not be the only way to convey important information because some users may not see or hear it.
Click to reveal answer
What happens when you add a title attribute to an HTML element?
AThe element becomes clickable
BA tooltip appears when hovering over the element
CThe element changes color
DThe element disappears
Which of these is a good use of the title attribute?
AAdding a background image
BChanging the font size
CAdding extra description to a link
DMaking text bold
Can the title attribute be used on an <img> tag?
AYes, to provide extra info about the image
BNo, it only works on links
CNo, it only works on buttons
DYes, but it hides the image
Why should the title attribute not be the only way to give important info?
ABecause some users may not see or hear tooltips
BBecause it slows down the website
CBecause it changes the page layout
DBecause it disables keyboard navigation
What accessibility benefit does the title attribute provide?
AIt makes text larger
BIt changes colors for colorblind users
CIt adds keyboard shortcuts
DScreen readers can read it to explain elements
Explain what the title attribute does in HTML and give an example of how it is used.
Think about what happens when you move your mouse over a link or image.
You got /3 concepts.
    Describe why the title attribute is helpful for accessibility and what its limitations are.
    Consider users who rely on audio or keyboard navigation.
    You got /4 concepts.