HTML Character Entities
Some characters like the < character, have a special meaning in HTML, and therefore cannot be used in the text.
To display a les 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# and an entity number, and finally a semicolon (;).
To display a less than sign in an HTML document we must write: ⁢ or <
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.
The Most Common Character Entities:
Result | Description | Entity Name | Entity Number |
Non-breaking
space |
|   | |
< | less than | ⁢ | < |
> | Greater than | > | > |
& | Ampersand | & | & |
“ | Quotation mark | " | " |
‘ | Apostrophe | '(does
Not work in IE) |
' |
Some Other Commonly Used Character Entities:
Result | Description | Entity Name | Entity Number |
¢ | Cent | &Cent |   |
£ | Pound | &Pound | £ |
¥ | Yen | &Yen | ¥ |
€ | Euro | &Euro | € |
§ | Section | &Section | § |
© | Copyright | &Copyright | © |
® | Registered
Trademark |
&Registered
Trademark |
® |
× | Multiplication | &Multiplication | × |
÷ | division | &Division | ÷ |
Some Other Commonly Used Character Entities:
Result | Description | Entity Name | Entity Number |
¢ | Cent | &Cent |   |
£ | Pound | &Pound | £ |
¥ | Yen | &Yen | ¥ |
€ | Euro | &Euro | € |
§ | Section | &Section | § |
© | Copyright | &Copyright | © |
® | Registered
Trademark |
&Registered
Trademark |
® |
× | Multiplication | &Multiplication | × |
÷ | division | &Division | ÷ |
HTML Links
HTML uses a hyperlink to link to another document on the web.
Hyperlinks are what make using the web so easy. By using HTML tags to embed the instructions on where other resources are located on the internet and how to access them, resources can be retrieved from anywhere on the internet by simply clicking on a link.
Although HTML was initially developed as a hypertext system, in which the instructions were embedded within the text of a web page, hyperlinks can now be embedded within forms of media, including images, videos and animation.
The Anchor Tag and the Href Attribute
HTML uses the <a> (anchor) tag to create a link to another document.
An anchor can point to any resource on the web: an HTML page, an image, a sound file, a movie, etc.
The syntax of creating an anchor:
<a href=”url”> Text to be displayed</a>
The <a> tag is used to create an anchor to link from, the href attribute is used to address the document to link to, and the words between the open and close of the anchor tab will be displayed as a hyperlink.
This anchor defines a link to Rgcsm:
<a href=http://www.rgcsm.org/”> Visit RGCSM!</a>
The line above will look like this in a browser.
Visit RGCSM
The Target Attribute
With the target attribute, you can define where the linked document will be opened.
The line below will open the document in a new browser window : <a href=http://www.rgcsm.org/ “
target =”_blank”>Visit Rgcsm! </a>
The Anchor Tag and the Name Attribute
The name attribute is used to create a named anchor. When using named anchors we can create links that can jump directly into a specific section on a page, instead of letting the user scroll around to find what he/she is looking for,
Below is the syntax of a named anchor: <a mane=”label”> Text to be displayed </a>
The name attribute is used to create a named anchor. The name of the anchor can be any text you care to use.
You should notice that a named anchor is not displayed in a special way.
To link directly to the “tips” section, add a # sign and the name of the anchor to the end of a URL. Like this: <a href=”http://www.rgcsm.org/html _links.asp#tips”>
Jump to the Useful Tips Section</a>
A hyperlink to the Useful Tips Section from WITHIN the file “htnl_links.asp” will look like this: <a href=”#tips”> Jump to the Useful Tips Section </a>
Basic Notes – Useful Tips
Always add a trailing slash to subfolder references. Of you link like this: href =”http://www.rgcsm.org/html”, you will generate two HTTP requests to the serve, because the server will add a slash to the address and create a new request like this: href=”http:www.rgcsm.org/html/”,
Named anchors are often used to create “table of contents” at the beginning of a large document. Each chapter within the document is given a named anchor, and links to each of these anchors are put at the top of the document.
If a browser cannot find a named anchor that has been specified, it goes to the top of the document. No error occurs.