Search

The Importance of HTML / XHTML Validation

0 views

In Part One I discussed the Benefits of HTML Validation. Part One can be viewed HTML 4.01 Strict, Transitional, Frameset <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">XHTML 1.0 Strict, Transitional, Frameset <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">XHTML1.1 DTD <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> Here's an example of a web site I recently designed which has correctly validated XHTML and CSS: http://www.w3schools.com/browsers/browsers_stats.asp 6. Test for different screen resolutions The current trend is that more and more computers are using a screen size of 1024x768 pixels: Here are the stats for June 2005: 1024x768..............................56% 800x600...............................28% Higher than 1024x768............11% 7. Check connectivity speeds Web pages that contain a large number of graphics or tables, use flash or video, will load slowly or sometimes not at all with a dial up connection but will be fine with a cable or dsl connection. Although the trend is towards people converting to high speed connections many still use dial-up to surf the Net for information. Therefore design your site for both. C.Validation Tools HTML/XHTML validation http://jigsaw.w3.org/css-validator/ Link checker http://www.anybrowser.com Connectivity Test http://www.netmechanic.com/maintain.htm D.Common HTML/XHTML validation errors Improper Nesting of Tags This is a very common error. You should close tags your in the reverse of the order you opened them: <xx><yy>content</yy></xx>. An easy error to make, but it's easy to fix, too. Missing alt tags You should include alt tags for all your images with a text description so that visitors will still know what the image is about even if they turn off viewing images in their browser. Improper closing of tags ie <p>This is a paragraph<p>. The end tag should be </p> It will validate in html, but not xhtml. For XHTML 1.0 validation it's easy to omit these closing tags: <br /> or <hr /> or <img src="xx.gif" /> Margin height and width marginheight="0" ^Error: there is no attribute "MARGINHEIGHT" for this element. Use CSS to fix this error. marginwidth="0" ^Error: there is no attribute "MARGINWIDTH" for this element. The only fix for this is to utilize CSS and absolute positioning. Horizontal Line Color <hr size="1" color="#C0C0C0"> ^Error: there is no attribute "COLOR" for this element. This can only be fixed with CSS. ie <div style="color:#000;background-color:#C0C0C0;height:1px;font-size:1px;"> </div> Border Color bordercolor="#ffffff" ^Error: there is no attribute "BORDERCOLOR" for this element. This can only be fixed with CSS. Unescaped Ampersand (XHTML) Always use & in place of &. Conclusion: If you get into the habit of always validating your web pages, your web site will be faster loading, more search engine friendly, accessible to a greater number of devices and therefore appeal to a larger number of visitors. Herman Drost is the Certified Internet Webmaster (CIW) owner and author of http://www.iSiteBuild.com. Affordable Web Site Design and Web Hosting. Subscribe to his "Marketing Tips" newsletter for more original articles. mailto:subscribe@isitebuild.com. Read more of his in-depth articles at:

Found an error or have a suggestion? Let us know and we'll review it.

Share this article

Comments (0)

Please sign in to leave a comment.

No comments yet. Be the first to comment!