Test Your Web Site for Valid HTML – How and Why

Test Your Web Site for Valid HTML – How and Why

To test your web site for valid HTML, you simply need to run it through the W3C’s validation tool, which can be found at: https://validator.w3.org/ Enter your site URL. It will give you a list of errors on your site, which you can then correct.

What is Valid HTML?

HTML is the a structured language used to create web pages. All web pages are made of it. All brosers read it. But mostly only web developers and designers worry about it. And even less of us worry about whether you have valid HTML or not. HTML has rules, like any language. and those rules which are fairly strict. HTML is valid when it follows all those rules. However, browsers are designed to work for as many people as possible, not to enforce rules. So they fail, gracefully, when a site breaks the rules. Which means that web sites do get away with breaking the rules, and they work, at least to your eyes, when invalid. Most sites have quite a few errors.

Why does it matter?

This matters because not everyone uses browsers that fail gracefully. Blind visitors to your site can only read the text, and if you do not have a text description on all your images, their screen reader might not make sense of the page. If the a page’s structure is broken, the browser might be able to figure it out and display it on the screen anyway, but the search engines might give up, and not put your page in the search results. Or if someone shares your page on Facebook, instead of showing your logo from the top of your screen, it might grab a random photo from a blog post from 4 years ago because your site structure wasn’t clear about which photo was the logo.

In short, properly structuring your site matters to improve the performance of your site in search engines, to share it effectively via social media, and to make it accessible to all readers. Producing valid HTML isn’t the only step to having an effective site. But it is a quick, easy step to making that happen, and there is little reason to not make the effort to have a valid web site.

How do I correct the errors?

If you wrote your own site, the error list from the validator page will tell you exactly which line each error came from, and you can make the corrections directly. If someone else made your site for you, ask them to correct the errors.

I often see many error comes out of WordPress, and people often have trouble tracking them down — In WordPress, they can come from your content, the theme you use, or a plugin you installed.  All of these can be fixed, but requires changes to the code of your site, so would probably be better approached as a consulting project.

 

 

Comments are closed.