Showing posts with label HTML. Show all posts
Showing posts with label HTML. Show all posts

Thursday, May 5, 2011

Character Entities

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: &lt; or &#60;
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 &nbsp; character entity.

The Most Common Character Entities:

Result
Description
Entity Name
Entity Number

non-breaking space
&nbsp;
&#160;
less than
&lt;
&#60;
greater than
&gt;
&#62;
&
ampersand
&amp;
&#38;
"
quotation mark
&quot;
&#34;
'
apostrophe 
&apos; (does not work in IE)
&#39;

Some Other Commonly Used Character Entities:

Result
Description
Entity Name
Entity Number
¢
cent
&cent;
&#162;
£
pound
&pound;
&#163;
¥
yen
&yen;
&#165;
euro
&euro;
&#8364;
§
section
&sect;
&#167;
©
copyright
&copy;
&#169;
®
registered trademark
&reg;
&#174;
×
multiplication
&times;
&#215;
÷
division
&divide;
&#247;

Wednesday, April 20, 2011

HTML Color Names

HTML colors are defined using a hexadecimal notation for the combination of Red, Green, and Blue color values (RGB). The lowest value that can be given to one of the light sources is 0 (hex #00). The highest value is 255 (hex #FF). 

If your having some trouble in acquiring what color you should have in your own blog/site and yet you don't know what its code in Hexadecimal, well here is a big help for you. The table below provides a list of the color names that are supported by all major browsers.

Color HEX
Color























































































































Red 

















Tan