From 754bbf7a25a8dda49b5d08ef0d0443bbf5af0e36 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Sun, 7 Apr 2024 13:41:34 -0500 Subject: new repository --- devdocs/html/element%2Fabbr.html | 155 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 155 insertions(+) create mode 100644 devdocs/html/element%2Fabbr.html (limited to 'devdocs/html/element%2Fabbr.html') diff --git a/devdocs/html/element%2Fabbr.html b/devdocs/html/element%2Fabbr.html new file mode 100644 index 00000000..a429eb88 --- /dev/null +++ b/devdocs/html/element%2Fabbr.html @@ -0,0 +1,155 @@ +

<abbr>: The Abbreviation element

+

The <abbr> HTML element represents an abbreviation or acronym.

When including an abbreviation or acronym, provide a full expansion of the term in plain text on first use, along with the <abbr> to mark up the abbreviation. This informs the user what the abbreviation or acronym means.

The optional title attribute can provide an expansion for the abbreviation or acronym when a full expansion is not present. This provides a hint to user agents on how to announce/display the content while informing all users what the abbreviation means. If present, title must contain this full description and nothing else.

+
+

Try it

+
+

Attributes

+
+

This element only supports the global attributes. The title attribute has a specific semantic meaning when used with the <abbr> element; it must contain a full human-readable description or expansion of the abbreviation. This text is often presented by browsers as a tooltip when the mouse cursor is hovered over the element.

Each <abbr> element you use is independent of all others; providing a title for one does not automatically attach the same expansion text to others with the same content text.

+
+

Usage notes

+ +

Typical use cases

+
+

It's certainly not required that all abbreviations be marked up using <abbr>. There are, though, a few cases where it's helpful to do so:

+
+

Grammar considerations

+

In languages with grammatical number (that is, languages where the number of items affects the grammar of a sentence), use the same grammatical number in your title attribute as inside your <abbr> element. This is especially important in languages with more than two numbers, such as Arabic, but is also relevant in English.

+

Default styling

+
+

The purpose of this element is purely for the convenience of the author and all browsers display it inline (display: inline) by default, though its default styling varies from one browser to another:

Some browsers add a dotted underline to the content of the element. Others add a dotted underline while converting the contents to small caps. Others may not style it differently than a <span> element. To control this styling, use text-decoration and font-variant.

+
+

Examples

+ +

Marking up an abbreviation semantically

+
+

To mark up an abbreviation without providing an expansion or description, use <abbr> without any attributes, as seen in this example.

HTML

+

html

+
<p>Using <abbr>HTML</abbr> is fun and easy!</p>
+
+

Result

+
+ + +
+
+

Styling abbreviations

+
+

You can use CSS to set a custom style to be used for abbreviations, as seen in this simple example.

HTML

+

html

+
<p>Using <abbr>CSS</abbr>, you can style your abbreviations!</p>
+
+

CSS

+

css

+
abbr {
+  font-variant: all-small-caps;
+}
+
+

Result

+
+ + +
+
+

Providing an expansion

+
+

Adding a title attribute lets you provide an expansion or definition for the abbreviation or acronym.

HTML

+

html

+
<p>Ashok's joke made me <abbr title="Laugh Out Loud">LOL</abbr> big time.</p>
+
+

Result

+
+ + +
+
+

Defining an abbreviation

+
+

You can use <abbr> in tandem with <dfn> to more formally define an abbreviation, as shown here.

HTML

+

html

+
<p>
+  <dfn id="html"><abbr title="HyperText Markup Language">HTML</abbr> </dfn> is a
+  markup language used to create the semantics and structure of a web page.
+</p>
+
+<p>
+  A <dfn id="spec">Specification</dfn> (<abbr>spec</abbr>) is a document that
+  outlines in detail how a technology or API is intended to function and how it
+  is accessed.
+</p>
+
+

Result

+
+ + +
+
+

Accessibility concerns

+
+

Spelling out the acronym or abbreviation in full the first time it is used on a page is beneficial for helping people understand it, especially if the content is technical or industry jargon.

Only include a title if expanding the abbreviation or acronym in the text is not possible. Having a difference between the announced word or phrase and what is displayed on the screen, especially if it's technical jargon the reader may not be familiar with, can be jarring.

HTML

+

html

+
<p>
+  JavaScript Object Notation (<abbr>JSON</abbr>) is a lightweight
+  data-interchange format.
+</p>
+
+

Result

+
+ + +

This is especially helpful for people who are unfamiliar with the terminology or concepts discussed in the content, people who are new to the language, and people with cognitive concerns.

+
+

Technical summary

+
Content categories Flow content, phrasing content, palpable content
Permitted content Phrasing content
Tag omission None, both the starting and ending tag are mandatory.
Permitted parents Any element that accepts phrasing content
Implicit ARIA role No corresponding role
Permitted ARIA roles Any
DOM Interface HTMLElement
+

Specifications

+
+ + +
Specification
HTML Standard
# the-abbr-element
+

Browser compatibility

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariWebView AndroidChrome AndroidFirefox for AndroidOpera AndroidSafari on IOSSamsung Internet
abbr212
1Before Firefox 4, this element implemented the HTMLSpanElement interface instead of the standard HTMLElement interface.
71544.4184143.21.0
+

See also

+
+

+ © 2005–2023 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
+ https://developer.mozilla.org/en-US/docs/Web/HTML/Element/abbr +

+
-- cgit v1.2.3