How do I validate my Web HTML pages?
How do I validate my Web pages and end up with one of those nifty "xhtml 1.0 verified" graphics for my page?
Worse, the World Wide Web Consortium published a formal, but almost incomprehensible specification that detailed exactly the valid and legal HTML language structure for each generation of HTML.
The idea of a validator is that you can feed it the address of a Web page, specify exactly what 'flavor' of HTML you've written it in, and it'll then parse and analyze the actual tag structure to see if it's all legal. There are a surprisingly large number of different flavors of HTML too, but the newest and most important is called XHTML, a slight twist on HTML 4 that enforces XML-based syntax.
In a nutshell, this means that you can't do something like this:
Sample line one. <p> Sample line two. <P align=center> Sample line<br>three.
Why? Because the paragraph tag is a container tag: it needs a closing </p> each time it's used. Further, all xhtml tags MUST be in all lowercase, so the second <P> is wrong in that regard too. Finally, every argument must be quoted (e.g., align="center") and every non-paired tag must end with the rather odd looking space+slash+angle sequence: <br /> not <br>
So why bother? Because as more sophisticated Web-based tools appear on the network, they are more and more relying on properly formed pages. Ditto the latest generation of browsers. And in general, it's just good karma to have clean, properly written pages, just as it's best to communicate with proper spelling and grammar.
STRUCTURING A PAGE FOR VALIDATION
So that's the long answer as to why validation is useful. To actually validate a Web page you need to do two things:
TO VALIDATE YOUR PAGE
To validate your Web page, once you've added the ?xml and !DOCTYPE header lines as detailed, go to http://validator.w3.org/ and enter the full URL of the page. You can also upload files directly to their validator, but since I always have my projects online in a work directory, I let them find it directly.
If everything looks good, you'll run the validator and, assuming you're also writing to xhtml 1.0 transitional, it'll come back with the cheery message:
This Page Is Valid XHTML 1.0 Transitional!
Otherwise you'll see:
This page is not Valid XHTML 1.0 Transitional!
and it'll give a detailed list of the problems it found and why they're a problem. Fix them, submit the URL again, and you should be able to get to the success message.
Then, finally, at the bottom of that page is the information on how to link to the neato graphical buttons on your own validated pages.
✔ How to Create Predefined Google Image Search Links?
Thanks for the Amazon URL [see Creating Amazon Search Links]. That worked beautifully. In fact, I sent you $5.00 for coffee in thanks....✔ Can I embed a Facebook search box on my blog site?
I've seen your articles about how to add a Twitter or Google search box on a Web page, but I have a tougher...✔ Can I use CSS for drop shadows on my blog?
I want to give my site a bit of a facelift and add some neat graphical elements. One of which is drop shadows....✔ How can I embed interactive photo panoramas on my site/blog?
I read through your blog entry about how to take panoramic photos with iOS 6 and an iPhone 5 and got enthused. I've...✔ How can I create a Twitter search URL shortcut?
I'd like to add a few Twitter search links to my Web site. Is that possible, or does Twitter prohibit this sort of...
Let's stay in touch!
Sign up for my weekly AskDaveTaylor Newsletter and you'll receive even more tech and gadget help right to your inbox, along with exclusive news and industry updates. It's good stuff. I promise!
I do have a comment, now that you mention it!
Check This Out Too...
Look for Answers
All Our Categories
Apple iPad Help
Articles and Reviews
Auctions and Online Shopping
Blogs and Blogging
Building Web Site Traffic
Business and Management
Computer and Internet Basics
d) None of the Above
Google Gmail Help
Google Plus Help
Industry News and Trade Shows
iPhone and Cell Phone Help
iPod, Sony PSP and MP3 Player Help
Kindle Fire Help
Mac OS X Help
Pay Per Click (PPC) Advertising
Search Engine Optimization (SEO)
Shell Script Programming
Tech Support Video Help
The Writing Business
Twitter, LinkedIn and Social Network Help
Unix and Linux Help
Video Game Tips and Help
Windows PC Help
Find Me on Google+
ADT on G+