FREE eBook - XHTML Basics

Most webpage coders are familiar with HTML (HyperText Markup Language), but when they
see the term XHTML many of they say "what the heck is XHTML". Well, you may have noticed
that HTML and XHTML (Extensible HyperText Markup Language) look very similar. They
both use tags that are delimited with < and > characters.
But HTML was designed long before XHTML and therefore is less rigorous. In other
words, HTML does not require the coder to follow strict rules, while if you don't
strictly follow the rules while coding XHTML, it just plain won't work. XHTML
is an attempt to make HTML as rigorous as XML. In fact an XHTML webpage
IS an XML document.
Contents:
- Tag names must be in lower case
- Attribute names must be in lower case
- Attribute values must be in quotes
- Attribute shorthand is not allowed
- Use the id attribute instead of the name attribute
- Use the id attribute instead of the fragment identifier
- Tags must be properly nested
- All tags must be closed
- Proper Use of Ampersands
- Coding XHTML Compatible Forms
- The Web page must have proper structure
- The Web page must have a DOCTYPE declaration
- Validate Your XHTML
Why should you care about XHTML? Because with every new version of HTML, more of the old HTML
becomes deprecated. Deprecated meaning don't count on it to work in the future. At some
time in the future, parts of your Web site may stop working because some old HTML code has been
discontinued. Webmaster's with sites that were created many years ago should start the process of
updating their code to the XHTML standard. If you're creating a new Web site, you have the
opportunity to start out with XHTML.
|