Character Formatting

Sr.No.
Topics
1

Logical Styles Vs. Physical Styles

2
Escape Sequences

 

Escape Sequences (a.k.a. Character Entities)

Character entities have two functions:

  • escaping special characters
  • displaying other characters not available in the plain ASCII character set (primarily characters with diacritical marks)
Three ASCII characters--the left angle bracket (<), the right angle bracket (>), and the ampersand (&)--have special meanings in HTML and therefore cannot be used "as is" in text. (The angle brackets are used to indicate the beginning and end of HTML tags, and the ampersand is used to indicate the beginning of an escape sequence.) Double quote marks may be used as-is but a character entity may also be used (").

To use one of the three characters in HTML document, you must enter its escape sequence instead:

&lt;
the escape sequence for <
&gt;
the escape sequence for >
&amp;
the escape sequence for &

Additional escape sequences support accented characters, such as:

&ouml;
a lowercase o with an umlaut: ö
&ntilde;
a lowercase n with a tilde: ñ
&Egrave;
an uppercase E with a grave accent: È
You can substitute other letters for the o, n, and E shown above.

NOTE: Unlike the rest of HTML, the escape sequences are case sensitive. You cannot, for instance, use &LT; instead of &lt;.