HTML and CSS Reference
In-Depth Information Special text characters
Not all text characters available to you for display by a browser can be
typed from the keyboard. And some characters have special meanings,
such as the brackets around tags, which if not somehow differentiated
when used for plain textthe less-than sign ( < ) in a math equation, for
examplewill confuse the browser and trash your document. HTML and
XHTML give you a way to include any of the many different characters
that comprise the Unicode character set anywhere in your text through
a special encoding of its character entity .
Like the copyright symbol in our simple example, a character entity
starts with an ampersand ( & ), followed by its name, and terminated with
a semicolon ( ; ). Alternatively, you may also use the character's posi-
tion number in the Unicode table of characters, preceded by the pound
or sharp sign ( # ), in lieu of its name in the character-entity sequence.
When rendering the document, the browser displays the proper charac-
ter, if it exists in the user's font. [ Character Entities, 3.5.2 ]
For obvious reasons, the most commonly used character entities are
the greater-than ( &gt; ), less-than ( &lt; ), and ampersand ( &amp; ) char-
acters. Check Appendix F to find out what symbol the character entity
&#166; represents. You'll be pleasantly surprised&#033;
2.6.2. Text Structures
It's not obvious in our simple example, but the common carriage returns
we use to separate paragraphs in our source document have no mean-
ing in HTML or XHTML, except in special circumstances. You could have
typed the document onto a single line in your text editor, and it would
still appear the same in Figure 2-1 . [*]
[*] We use a computer programming-like style of indentation so that our source HTML/XHTML docu-
ments are more readable. It's not obligatory, nor are there any formal style guidelines for source HTML/
XHTML document text formats. We do, however, highly recommend that you adopt a consistent style
so that you and others can easily follow your source documents.
Search WWH ::

Custom Search