0% found this document useful (0 votes)
5 views1 page

9

The document explains the use of the abbr element in HTML to display abbreviations with additional information through the title attribute. It also discusses character and entity references in HTML, detailing how to escape special characters to ensure proper rendering and accessibility across different browsers. Additionally, it provides examples of HTML escape sequences for various characters.

Uploaded by

Bhushan Mahajan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views1 page

9

The document explains the use of the abbr element in HTML to display abbreviations with additional information through the title attribute. It also discusses character and entity references in HTML, detailing how to escape special characters to ensure proper rendering and accessibility across different browsers. Additionally, it provides examples of HTML escape sequences for various characters.

Uploaded by

Bhushan Mahajan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

he abbreviation element, abbr, can be used to demonstrate some of these attributes:

<abbr id="anId" class="jargon" style="color:purple;" title="Hypertext Markup


Language">HTML</abbr>
This example displays as HTML; in most browsers, pointing the cursor at the
abbreviation should display the title text "Hypertext Markup Language."

Most elements take the language-related attribute dir to specify text direction,
such as with "rtl" for right-to-left text in, for example, Arabic, Persian or
Hebrew.[79]

Character and entity references


See also: List of XML and HTML character entity references and Unicode and HTML
As of version 4.0, HTML defines a set of 252 character entity references and a set
of 1,114,050 numeric character references, both of which allow individual
characters to be written via simple markup, rather than literally. A literal
character and its markup counterpart are considered equivalent and are rendered
identically.

The ability to "escape" characters in this way allows for the characters < and &
(when written as &lt; and &amp;, respectively) to be interpreted as character data,
rather than markup. For example, a literal < normally indicates the start of a tag,
and & normally indicates the start of a character entity reference or numeric
character reference; writing it as &amp; or &#x26; or &#38; allows & to be included
in the content of an element or in the value of an attribute. The double-quote
character ("), when not used to quote an attribute value, must also be escaped as
&quot; or &#x22; or &#34; when it appears within the attribute value itself.
Equivalently, the single-quote character ('), when not used to quote an attribute
value, must also be escaped as &#x27; or &#39; (or as &apos; in HTML5 or XHTML
documents[80][81]) when it appears within the attribute value itself. If document
authors overlook the need to escape such characters, some browsers can be very
forgiving and try to use context to guess their intent. The result is still invalid
markup, which makes the document less accessible to other browsers and to other
user agents that may try to parse the document for search and indexing purposes for
example.

Escaping also allows for characters that are not easily typed, or that are not
available in the document's character encoding, to be represented within the
element and attribute content. For example, the acute-accented e (é), a character
typically found only on Western European and South American keyboards, can be
written in any HTML document as the entity reference &eacute; or as the numeric
references &#xE9; or &#233;, using characters that are available on all keyboards
and are supported in all character encodings. Unicode character encodings such as
UTF-8 are compatible with all modern browsers and allow direct access to almost all
the characters of the world's writing systems.[82]

Example HTML Escape Sequences


Named Decimal Hexadecimal Result Description Notes
&amp; &#38; &#x26; & Ampersand
&lt; &#60; &#x3C; < Less Than
&gt; &#62; &#x3E; > Greater Than
&quot; &#34; &#x22; " Double Quote
&apos; &#39; &#x27; ' Single Quote
&nbsp; &#160; &#xA0; Non-Breaking Space
&copy; &#169; &#xA9; © Copyright
&reg; &#174; &#xAE; ® Registered Trademark
&dagger; &#8224; &#x2020; † Dagger
&ddagger; &#8225; &#x2021; ‡ Double dagger

You might also like