Abbr marks an abbreviation; the optional title can give its expanded form. This helps explain unfamiliar terms such as HTML to new readers.
What You Need to Know
Do not make understanding depend entirely on hover tooltips. Explain an important abbreviation in visible text the first time it appears.
Example: See It in Action
Here is a simple example to experiment with. Type it, save the file, and check what the browser displays.
This is a short HTML fragment. To try it as a webpage, put it inside the body element of a complete HTML document.
<p><abbr title="HyperText Markup Language">HTML</abbr> structures web pages.</p>
<p><abbr title="Cascading Style Sheets">CSS</abbr> controls appearance.</p>
<p>The full phrase helps readers learn each acronym.</p>
Let’s Understand the Example
- Abbr marks an abbreviation, while its title can provide an expansion.
- A p groups a paragraph of related text. Start another paragraph for a new thought.
- Title adds advisory information, but it is not a substitute for readable visible labels.
Look for the text “HTML” in the page. If the visible result surprises you, inspect the rendered elements to see what the browser actually built.
What Should You See?
The page should include “HTML”. If it looks different from what you expected, open developer tools and compare the source with the elements the browser created.
Try removing one piece of markup in a scratch copy, refresh the page, and compare the behavior. This is often the fastest way to understand what that piece contributes.
Try It Yourself
- Add an abbreviation used in science and write out its full form.
- Save your changes, open or refresh the page, and compare the result with the original example.
- Tell a friend what your change did. If you are not sure, undo it, refresh the page, and compare.
Common Beginner Mistakes
- Writing an abbreviation with no nearby explanation and assuming every reader can hover over it.
- Avoid picking tags just for their default bold, italic or spaced appearance. Use CSS for presentation.
Key Takeaways
- Abbr marks an abbreviation; the optional title can give its expanded form.
- Abbr marks an abbreviation, while its title can provide an expansion.
- Do not make understanding depend entirely on hover tooltips. Explain an important abbreviation in visible text the first time it appears.