Title Text Goes Here



Download 2.8 Mb.
View original pdf
Page23/37
Date16.06.2022
Size2.8 Mb.
#59010
1   ...   19   20   21   22   23   24   25   26   ...   37
com-225-web-technology-theory
How to View HTML Source
Have you ever seen a Web page and wondered "Hey How did they do that" To find out, click the VIEW option in your browser's toolbar and select SOURCE or PAGE SOURCE. This will open a window that shows you the HTML code of the page.


HTML Character Entities

TYPE THE DOCUMENT TITLE
42
Some characters like the < character, have a special
meaning in HTML, and therefore cannot be used in the text.
To display a less than sign (<) in HTML, we have to use a
character entity.

Character Entities
Some characters have a special meaning in HTML, like the less than sign (<) that defines the start of an HTML tag. If we want the browser to actually display these characters we must insert character entities in the HTML source.
A character entity has three parts: an ampersand (&), an entity name or a # and an entity number, and finally a semicolon (;).
To display a less than sign in an HTML document we must write:
< orb b The advantage of using a name instead of a number is that a name is easier to remember. The disadvantage is that not all browsers support the newest entity names, while the support for entity numbers is very good in almost all browsers.
Note that the entities are case sensitive.
Non-breaking Space
The most common character entity in HTML is the non-breaking space. Normally HTML will truncate spaces in your text. If you write 10 spaces in your text HTML will remove 9 of them. To add spaces to your text, use the   character entity.

TYPE THE DOCUMENT TITLE
43


The Most Common Character Entities
Result Description
Entity Name
Entity
Number
non-breaking space
 
 
< less than
<
<
> greater than gt
>
& ampersand amp
&
" quotation mark quot
"
' apostrophe
' (does notwork in IE)
'

Download 2.8 Mb.

Share with your friends:
1   ...   19   20   21   22   23   24   25   26   ...   37




The database is protected by copyright ©ininet.org 2024
send message

    Main page