HTML and CSS Reference
In-Depth Information
would look like this:
Encoding Quirks and Considerations
Encoding characters is quite important if you want to validate your markup. For example,
consider when you have nontrivial query strings in (X)HTML links like so:
<p> Does this <a href="http://www.pint.com/program?p1=foo&p2=bar"> link </a>
validate? </p>
The markup will not validate.
For this line to validate, you must encode the special characters in the link like so:
<p> Does this <a href="http://www.pint.com/program?p1=foo&amp;p2=bar"> link </a>
validate? </p>
Do not, however, take this as advice to change ampersands in typed URLs everywhere you
encounter them, such as within e-mails or the browser's location bar. Typically, a browser
will exchange an entity for its correct value, but this change may not take place in other
environments.
Commonly, you will also have trouble when using characters that are part of (X)HTML
itself, particularly the less than (<) and greater than (>) symbols and, of course, the
ampersand that starts entities. As an example, consider this contrived example with a
mathematical expression:
<p> A silly math statement ahead x<y>z is dangerous to validation. </p>
Search WWH ::




Custom Search