Q: Why should I validate my HTML or XHTML files? PDF Print E-mail
Frequently Asked Questions (FAQ) - HTML and XHTML
Written by Ed Tittel and Rebekkah Hilgraves   

Ed's comment: The best reason for validation is to make sure you're not breaking or bending any rules of (X)HTML syntax.

Browsers can be entirely too forgiving sometimes, so even the most thorough browser-based page and site testing won't always catch subtle or unexpected errors. After 11 previous editions of this book, in fact, your authors learned some interesting things about nested lists in (X)HTML that we'd never bothered to check before. Purely as an example of how common understanding can sometimes subvert proper (X)HTML syntax, we observe that to meet the criteria for which elements may be included inside which other elements, we learned that a nested list (the inside list, that is) must be enclosed within a pair of <li></li> tags (or inside a valid list element in the outside list) to validate properly. Though every browser we tried doesn't balk at this common violation of proper (X)HTML syntax, it is indeed an error to omit the enclosing list item element for the inside list. Only our decision to validate everything for this book showed this to us!

Rebekkah's comment: An additional reason for validation is that if you do not have access to multiple browser types (not everyone tests on IE6, IE7, Netscape, Firefox, Flock, Safari, Opera, and Lynx after all!), this is a great way to make certain that your code will be rendered properly across those browser platforms -- how they actually appear on those other platforms is another topic altogether, and would probably provide enough good fodder for a separate book!



Share this page!
Reddit! Del.icio.us! JoomlaVote! Google! Live! Facebook! StumbleUpon! Yahoo! Free social bookmarking plugins and extensions for Joomla! websites!
Last Updated on Monday, 30 June 2008 11:32
 
Chapter Resources
Chapter 1
Chapter 2
Chapter 3
Chapter 4
Chapter 5
Chapter 6
Chapter 7
Chapter 8
Chapter 9
Chapter 10
Chapter 11
Chapter 12
Chapter 13
Chapter 14
Chapter 15
Chapter 16
Chapter 17
Chapter 18
Chapter 19
Chapter 20
Chapter 21
Chapter 22
Chapter 23
Feedback - send us a message
Featured Links:
Banner
Visit co-author
Ed Tittel's web site!
Visit co-author
Jeff Noble's web site!
Conquest Media
Web page layout and
hosting provided by
SheTech and Company. the power of the web. http://www.shetech.com