-
Notifications
You must be signed in to change notification settings - Fork 0
HTML CSS Coding Guidelines
The problems of representing characters in HTML have generally been solved thanks to better browsers. The problem of rendering characters remains.
Especially IE is notorious for its failures in this respect. It often fails to display a character, even though it could do that if it used all the fonts in the system. If a browser cannot render a character, it may show a small rectangle, possibly containing a question mark, ?, or some similar indicator. Here’s a quick test (character U+0840, which is probably not supported by any font on your computer): ࡀ.
- determine a set of commonly available fonts so that each of them contains all the characters you need (in an acceptable form)
- specify a list of those fonts, in order of preference, in a font-family rule
- additionally consider the possibility of embedding a font that contains the character and including it into the list, when you have a character that might not be available otherwise.
å(in decimal) represents the letter "a" with a small circle above it (used, for example, in Norwegian).
å(in hexadecimal) represents the same character.
å(in hexadecimal) represents the same character as well.
И(in decimal) represents the Cyrillic capital letter "I".
水(in hexadecimal) represents the Chinese character for water.
<represents the < sign.
>represents the > sign.
&represents the & sign.
"represents the " mark.
Usually the best option is to enter characters as such, using a Unicode-capable authoring tool and saving and serving the document as UTF-8 encoded. This makes the HTML source more readable and avoids steps that might introduce errors. Just make sure that UTF-8 is properly declared:
<!doctype html><meta charset=utf-8><title>Démonstration</title>
- the web server announces UTF-8 as the encoding in HTTP headers, Content-Type: text/html;charset=utf-8 (check this out using e.g. an HTTP header viewer like Web-sniffer), or
- the web server does not announce any encoding (just Content-Type: text/html) and you indicate the encoding in the document itself e.g. using
Use the character as such, in UTF-8 encoded data, or the numeric character reference
★or★. Do not use the★entity, which is a proposed HTML5 entity with very limited browser support . HTML5 drafts have an extended set of “Character entity references,” but the added names have limited browser support, and they add nothing to the expressive power of HTML, just quasi-mnemonic names to be used instead of code numbers.
for example)if you want to use this entity you can write like this. )
-
)(O) -
)(O) -
)(X)
- HTML4 specification does not contain the scedil entity.
- HTML5 specification does