Validating a webpage

Body

 

Summary

This article discusses validating a web page.

Environment

Any website.

Directions

Check your code

It is important to make sure the code for your webpages is valid, especially since different browsers treat code errors differently. Validating the code is one step in making sure your webpage can be viewed by all browsers. It can also catch errors that are easy to overlook, like forgetting to close tags. It will also catch things that web editing software may do, like extra style tags inserted by a WYSIWYG editor (like Dreamweaver) or non-standard code from Word's "Save as webpage" option. HTML and XHTML are the languages webpages are written in. CSS is combined with html/xhtml to give the browser instructions on page appearance.

The simplest way to validate code is the W3C validation service. There are several tools on that page for checking code.

Check links

The W3C also has a link checker on the same page. You can specify how many levels deep it should check, however, there is a limit to how many files it will check, so if there is a file with a lot of links, you may want to limit the depth.

For a more comprehensive look at your links and how people are using them, you may want to google webmaster tools or google analytics. Analytics will analyze your site use, including how people get to it and how they leave. You have to include some code on all the pages you want analytics to track. The webmaster tools will tell you what google searches found your page, how many people found it, or if a google bot tried to crawl your page and found a dead link.

Additional notes

Some sites allow php pages. PHP is processed by the web server, and the server sends html to the browser to view the page. You can see the difference if you look at the code for a page and compare it to what you see if you use your browser to view the source. Because of this, the line numbers you get from a validator may not match the line numbers in the original file.

You will get more consistent results using xhtml and css on php pages. However, xhtml is much more picky about things like closing tags.

You cannot use a service like the W3C validator or Google on pages secured by SSO.

Details

Details

Article ID: 1671
Created
Wed 5/27/20 9:56 AM
Modified
Fri 4/5/24 10:17 AM