Monday, March 10, 2014
HTML Coding for the Degree Symbol
Background
Some characters are deemed 'reserved characters' in HTML because of their use in HTML programming. For instance, the greater-than and less-than symbols cannot be displayed 'as is' on a Web page. Instead they are replaced by code known as 'character entities.' In addition to reserved figures, character entities are also used to insert glyphs such as mathematical, technical and currency symbols.The anatomy of a character entity looks like either&entity_name;or&entity_number;
Syntax
The degree symbol -- which looks like a tiny circle -- is an example of a character entity in HTML. Type either its entity number or its entity name as shown below. Do not add quotes or arrows around the code as you normally do with HTML tags.Entity name: °Entity number: °
Compatibility
At first glance, the entity name for the degree symbol seems like the smarter choice -- it is easier to memorize. Yet Web browsers tend to have a better support for entity numbers than entity names. To be on the safe side, make a habit of using entity numbers for the degree sign and other special characters. Use an HTML symbol reference for your convenience.
Usage
To insert the degree sign in a Web page, look for the area where you want it to appear. Insert the entity number or entity name between the HTML tags of its container. Do not place the code inside the arrows of an HTML tag or it will not appear. For example, if you want to insert the degree sign in a paragraph, it may look like this:The temperature yesterday was 57°F.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment