Forum Moderators: open
Being new to the whole validation thing, I decided to validate one page on my site. 116 errors. Great. Ok, that was for HTML 4.01 Transitional.
For kicks I switched the option over to XHTML 1.0 Transitional and and it came up with a very-much-celestial 865 errors.
I would assume that I should try validating for the version with the least amount of errors? Am I looking at this the wrong way?
4.01 transitional is the "everyman" version of HTML today. Understand what the errors are and fix them from the top down. You'll find that errors "cascade" and if you fix the top five, 30 other error reports can vanish -- so you probably won't have 116 separate fixes.
If you wrote XHTML you would know it -- it's a very different kind of code with tags like <br />, no uppercase tags, and so on.
Similarly, I wouldn't suggest trying 4.01 strict until you can easily make a 4.01 transitional page validate.
Your first attempt was the right one -- you just need to roll up your sleeves and climb the learning curve. My experience is that I'm very glad I'm doing it.
The DOCTYPE should be complete, see Declaring a doctype [webmasterworld.com].
Also it will help to declare your character set, either with a meta tag:
<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
or in your .htaccess file:
AddType 'text/html; charset=ISO-8859-1' html
Did you manage to fix all of the errors?
I help out on some other design forum somewhere else on the Net, and I have found that there are only about 20 common errors that people make with code, about 20 more that occasionally appear, and a few more that have been "one-offs" in thousands of websites reviewed. Learn the major 20 and you'll be validating all of your new pages within minutes, you'll stumble across some of the other errors from time to time thereafter.
Well I'd love to know who and why would choose "strict", when "transitional" seems so much easier.
Is it down to more browsers showing the same rendering?
Yes, that's a big part of it -- especially the "emerging" user agents on hand helds, etc. (although quirks mode vs standards mode is more important in that regard.)
Another big part of it for me is "future-proofing" my HTML. The shift from transitional to strict is a bigger deal than going from HTML (transitional) to XHTML (transitional), and the learning involved in making that transition has had amazing repurcussions for me in many areas of site building.
Right now I use both transitional and strict - transitional for the more ephemeral, hurry-hurry jobs and strict for development that is planned to be more long-term.
I've only changed over one legacy site to strict, however, and that was a bear. I'm still very glad it's done. Site maintenance is a lot easier now -- and whether it's part of the HTML version shift, or just the generally improved coding, SE traffic to the site has gone up about 40%.