0

What is meant by reserved charector and entities in html

what should I do if I want a space,&," etc.. in an html or webpage to display....????

21st Jan 2017, 1:09 AM
karl smokie
karl smokie - avatar
3 Réponses
+ 7
Space is   Ampersand is &
21st Jan 2017, 1:21 AM
David Sebastian Keshvi Illiakis
David Sebastian Keshvi Illiakis - avatar
+ 2
Reserved Characters are Characters that you cannot directly use inside an HTML file's innerHTML like: &, <space>, <, >, @ and other characters that are part of the building HTML structures. And there are specific keywords to output them like that &nbsp and &amp discussed by @cheeze.
21st Jan 2017, 3:25 AM
Erwin Mesias
Erwin Mesias - avatar
+ 1
It's safe to use html entities for replace all 'reserved' characters ( which are essentially the '<', '>', '&' and the quotes -- single and double ), but in the fact replace '<' during development is almost sufficient, as parser dont search for closing '>' if it doesn't find an opening one, and wouldn't print the '&' if it don't racongize a valid form of html entities. As said @cheeze, '&' is '&amp;' and '&nbsp;' is for 'Non Breakable SPace', which is used to avoid breaking line at a particular place... Others useful for 'reserved' characters are: '<' as '&lt;' ( Ligther Than ) and '>' as '&gt;' ( Greater Than ). There is an html entity for the 'real' typographic apostrophe ( &apos; ) since Html5 ( and Xml/Xhtml, but not Html4, where you can use '&rsquo;' -- right single quote ), but you must use hexadecimal form of html entities to encode the 'straight' quotes ( single and double ) used in coding ^^ However, they rarely are source of problems in an html source code...
21st Jan 2017, 10:24 AM
visph
visph - avatar