W3 have defined symbols &mail;
and &telephone;
in a draft proposal. I'd like to start using those now, even though they're not yet official.
Is there some way I can define this; e.g. &telephone; = ☎
?
My guess it it's not possible, and it's not really much of an issue - just curious as being able to create such custom character mappings could be interesting.
http://www.w3.org/TR/WD-wwwicn.html
When you want to insert a special character, select Insert > HTML > Special Characters. From there are you presented with a few of the most common, or you can choose “Other” to view all the characters available. Simply select the character you would like to insert and the code is inserted for you.
Some characters are reserved in HTML and they have special meaning when used in HTML document. For example, you cannot use the greater than and less than signs or angle brackets within your HTML text because the browser will treat them differently and will try to draw a meaning related to HTML tag.
HTML Symbol Entities Many mathematical, technical, and currency symbols, are not present on a normal keyboard. To add such symbols to an HTML page, you can use the entity name or the entity number (a decimal or a hexadecimal reference) for the symbol.
it would be really easy to implement this JavaScript.
var el=document.getElementById('element');
el.innerHTML=el.innerHTML.replace(/\&telephone\;/g,'☎').replace(...........
It's a much better idea though to do this on the server side. e.g. in PHP you could use the strreplace($needle,$haystack) function or define a telephone constant.
define('telephone','☎');
//...
echo'<span>',telephone,' 001 23456789</span>';
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With