Special Characters. Special Characters in XHTML: Some common characters cannot be written directly...
-
Upload
alexandrina-jefferson -
Category
Documents
-
view
216 -
download
2
Transcript of Special Characters. Special Characters in XHTML: Some common characters cannot be written directly...
Special Characters
Special Characters in XHTML:
Some common characters cannot be written directly into our code as the XHTML processor (browser) would confuse them for our markup (code).
Sometimes we need to show a character that is not on the typical keyboard, such as a copyright symbol or a character from a foreign language.
Another issue is that XHTML ignores multiple spaces, but there are occasions in which we want to display multiple consecutive spaces.
We solve all these issues by using special characters.
Common Special Characters:
Special Character XHTML Code Displays As
Blank Space
Open or Close Quote " "
Ampersand & &
Less Than < <
Greater Than > >
The last four characters in this table would easily confuse the browser. Without using this method, how would it know whether we
were writing XHTML code or whether we wanted to display the character itself?
More Special Characters:
Special Character XHTML Code Displays As
Cent Sign ¢ ¢
Copyright Symbol © ©
Trademark Symbol ® ®
1/2 Fraction ½ ½
Inverted Question Mark ¿ ¿
Small e, Acute Accent é é
These are just a sample of the dozens of special characters available to use.
Example Special Characters:<body>
<p>3 extra spaces: here</p>
<p>quote: "in quotes"</p>
<p>ampersand: &</p>
<p>less than: <</p>
<p>greater than: ></p>
<p>cent sign: ¢</p>
<p>small e (acute): café</p>
</body>
3 extra spaces: here
quote: "in quotes"
ampersand: &
less than: <
greater than: >
cent sign: ¢
small e (acute): café