HTML Character Entities
Previous Next
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: < 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.
This example lets you experiment with character entities: Character Entities
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 ¢ ¢
£ pound £ £
¥ yen ¥ ¥
€ euro € €
§ section § §
© copyright © ©
® registered trademark ® ®
× multiplication × ×
÷ division ÷ ÷
To see a full list of HTML character entities go to our HTML Entities Reference.
Previous Next
Ektron
Ektron Ektron CMS400.NET lets you do everything you need to do on the Web and everything you want to do...all with just one application.
What can you do with Ektron CMS400.NET Version 7.5?
Ektron Author/edit content, manage navigation, menus, audit trails, workflow and approvals with the best in breed Content Management
Ektron Make your Web site the place for people to meet with the new Social Networking Platform
Ektron Interact with features like tagging, flagging and ratings found in the Web 2.0 Toolbox
Ektron Promote collaboration among coworkers in your organization by creating project workspaces where others can efficiently find information and work together
Ektron Discover information quickly and intuitively with enhanced search
Ektron Communicate with friends and colleagues with enterprise-level forums and corporate blogging capabilities
Ektron Build your viral marketing strategy with with subscriptions, web alerts and RSS feeds
See why there are 20,000+ Ektron integrations worldwide.
Request an INSTANT DEMO or download a FREE TRIAL today.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment