HTML <abbr> Tag 📝
dev.to·2d·
Discuss: DEV
🔖Bookmarklets
Preview
Report Post

Ever wanted to be super semantic and helpful to your users and machines? The HTML <abbr> tag is your secret weapon for abbreviations! It’s tiny, but mighty for accessibility and clarity. Let’s dive in!

What it Does 🧙‍♀️

The <abbr> tag marks up an abbreviation or acronym. Its superpower? When you add a title attribute, it creates a magical tooltip on hover, revealing the full term!

<abbr title="Today I Learned">TIL</abbr> something awesome!

Styling Shenanigans 🎨

Browsers can be a bit... inconsistent with <abbr>’s default look (looking at you, Safari!). Good news: it’s super easy to style!

abbr {
text-decoration: underline blue dotted; /* Custom underline! */
color: blue;
cursor: help; /* A friendly cursor to indicate more info! */
}

###…

Similar Posts

Loading similar posts...