search

HTML abbr Tag

Sep 04, 2024 pm 04:26 PM
htmlhtml5HTML TutorialHTML PropertiesHTML tags

HTML 5 has interesting features that make designing HTML web pages simpler using minimal writing of code. It provides a rich set of interesting tags to design web elements. One such tag is useful, which is known as tag. This tag is used to define and display an abbreviation in the one go. The HTML abbr tag will allow us to define the full form of abbreviations or acronyms, and the browser will display the short-form version of letters normally on a web page, but upon hovering over those abbreviations, the browser will display the full form of that acronym automatically.

Syntax of HTML abbr Tag

The tag is generally used along with the attribute. As the title tag is used to define the title of the document, the title, when used with the <abbr> tag, becomes an attribute and has a special meaning to it. The title will contain the human-readable title or the full form of an acronym. The <abbr> tag displays the full form on hovering to the user and makes it simplified to define the description. This information is much more useful to browsers, search engines and assistive systems like the translation system. Below is the syntax of the abbr tag,</abbr></abbr>

  • Normal abbr Tag:
<abbr> PFA </abbr>

This will only display simple text without any meaning. Suppose we want to use assign full form for the above abbreviation, i.e. PFA, then

attribute is used, <ul> <li><strong>abbr Tag with Title Tag:</strong></li> </ul> <pre class="brush:php;toolbar:false"><abbr title="Please Find Attached"> PFA </abbr></pre> <p>Here, we have defined the display title as short-form, but at the same time, we have defined the full form of it using the <abbr> tag along with the <title> tag. The <abbr> tag comes as pair, so there will always be a closing </abbr> tag available.

Attributes: As we have seen in the syntax, the title tag, when used along with the tag, becomes an attribute and assigns special functionality to it. Otherwise, there are no more specific tags available to use with the tag, but this tag supports the global attributes and event attributes that are available by default in HTML.

Examples to Implement HTML abbr Tag

Below are the examples of implementing the HTML abbr tag:

Example #1

In this example, we can see the Simple abbr without a Title Tag.

Code:



 abbr tag in HTML 



<abbr> PFA </abbr>

Output: will be a simple text as below,

HTML abbr Tag

Example #2

In this example, we can see the abbr With a Title Tag.

Code:



 abbr tag in HTML 



<abbr title="Please Find Attached"> PFA </abbr>

Output: will be an acronym with a dotted underline.

HTML abbr Tag

If we try to hover over this, it will display the title that we have given in a similar way to the tooltip.

Example #3

Here, we have used the CSS styling element font style as italic over the tag.

Code:



 abbr tag in HTML 



while writing an email, generally <abbr title="Please Find Attached"> PFA </abbr> is used

Output:

HTML abbr Tag

Example #4

Let’s use some more CSS styling elements over tag.

Code:



 abbr tag in HTML 



while writing an email, generally <abbr title="Please Find Attached"> PFA </abbr> is used

Output:

HTML abbr Tag

Here, we have made our acronym as bold and red using the CSS styling elements.

Example #5

Let’s modify the same example to add more styling and designing.

Code:



 abbr tag in HTML 



while writing an email, generally <abbr title="Please Find Attached"> PFA </abbr> is used

Output:

HTML abbr Tag

In each of the examples above, try to hover above the acronym we have used, i.e. PFA, and see how the browser will display the title we have assigned to it.

Important Points to Remember

  • The tag is supported by almost all browsers, including Google Chrome, Internet Explorer, Safari, Firefox, Opera, etc. The output produced by all the browsers may differ in some cases, but the result is the same.
  • As there are no specific attributes available with the tag, we will see how can we stylize the attribute (using global attributes available) in the next examples. The default styling to display this element is display: inline, and it may vary from browser to browser.
  • The tag can be used to provide the user with the full form or while definition in specific content or maybe in case of styling the document. It is not compulsory to always use the tag.
  • The attribute is used to provide full information or the full form of the specified acronym in the <abbr> tag. The <title> attribute is optional, and it will be used in the starting tag of the <abbr> tag.</abbr>
  • There used to be a tag before HTML 5 to define the abbreviations or acronyms, but it is deprecated from HTML 5 and should not be used.

Conclusion

So, we have seen the tag, which is introduced in HTML 5. This tag provided the way to define the abbreviations or acronyms and display their titles or detailed information in one go. We have seen multiple examples of attribute. There are no such special attributes available with this tag.

The above is the detailed content of HTML abbr Tag. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
The Future of HTML: Evolution and Trends in Web DesignThe Future of HTML: Evolution and Trends in Web DesignApr 17, 2025 am 12:12 AM

The future of HTML is full of infinite possibilities. 1) New features and standards will include more semantic tags and the popularity of WebComponents. 2) The web design trend will continue to develop towards responsive and accessible design. 3) Performance optimization will improve the user experience through responsive image loading and lazy loading technologies.

HTML vs. CSS vs. JavaScript: A Comparative OverviewHTML vs. CSS vs. JavaScript: A Comparative OverviewApr 16, 2025 am 12:04 AM

The roles of HTML, CSS and JavaScript in web development are: HTML is responsible for content structure, CSS is responsible for style, and JavaScript is responsible for dynamic behavior. 1. HTML defines the web page structure and content through tags to ensure semantics. 2. CSS controls the web page style through selectors and attributes to make it beautiful and easy to read. 3. JavaScript controls web page behavior through scripts to achieve dynamic and interactive functions.

HTML: Is It a Programming Language or Something Else?HTML: Is It a Programming Language or Something Else?Apr 15, 2025 am 12:13 AM

HTMLisnotaprogramminglanguage;itisamarkuplanguage.1)HTMLstructuresandformatswebcontentusingtags.2)ItworkswithCSSforstylingandJavaScriptforinteractivity,enhancingwebdevelopment.

HTML: Building the Structure of Web PagesHTML: Building the Structure of Web PagesApr 14, 2025 am 12:14 AM

HTML is the cornerstone of building web page structure. 1. HTML defines the content structure and semantics, and uses, etc. tags. 2. Provide semantic markers, such as, etc., to improve SEO effect. 3. To realize user interaction through tags, pay attention to form verification. 4. Use advanced elements such as, combined with JavaScript to achieve dynamic effects. 5. Common errors include unclosed labels and unquoted attribute values, and verification tools are required. 6. Optimization strategies include reducing HTTP requests, compressing HTML, using semantic tags, etc.

From Text to Websites: The Power of HTMLFrom Text to Websites: The Power of HTMLApr 13, 2025 am 12:07 AM

HTML is a language used to build web pages, defining web page structure and content through tags and attributes. 1) HTML organizes document structure through tags, such as,. 2) The browser parses HTML to build the DOM and renders the web page. 3) New features of HTML5, such as, enhance multimedia functions. 4) Common errors include unclosed labels and unquoted attribute values. 5) Optimization suggestions include using semantic tags and reducing file size.

Understanding HTML, CSS, and JavaScript: A Beginner's GuideUnderstanding HTML, CSS, and JavaScript: A Beginner's GuideApr 12, 2025 am 12:02 AM

WebdevelopmentreliesonHTML,CSS,andJavaScript:1)HTMLstructurescontent,2)CSSstylesit,and3)JavaScriptaddsinteractivity,formingthebasisofmodernwebexperiences.

The Role of HTML: Structuring Web ContentThe Role of HTML: Structuring Web ContentApr 11, 2025 am 12:12 AM

The role of HTML is to define the structure and content of a web page through tags and attributes. 1. HTML organizes content through tags such as , making it easy to read and understand. 2. Use semantic tags such as, etc. to enhance accessibility and SEO. 3. Optimizing HTML code can improve web page loading speed and user experience.

HTML and Code: A Closer Look at the TerminologyHTML and Code: A Closer Look at the TerminologyApr 10, 2025 am 09:28 AM

HTMLisaspecifictypeofcodefocusedonstructuringwebcontent,while"code"broadlyincludeslanguageslikeJavaScriptandPythonforfunctionality.1)HTMLdefineswebpagestructureusingtags.2)"Code"encompassesawiderrangeoflanguagesforlogicandinteract

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Chat Commands and How to Use Them
1 months agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools