Validating your website

In computer programming, there are broadly speaking two kinds of problems with code: With most programming languages, the first error is incredibly easy to spot — your program will just refuse to run or compile until the error is fixed.This makes finding and fixing these types of bugs much easier in those general head-scratching moments of “So why isn’t it doing what I want? Syntax errors in a web page do not commonly cause the web browser to refuse to open the page (although XHTML tends to be a lot stricter than HTML — at least when served as "[proper XML]").Validating your Web page won't guarantee that it will appear just the way you want it.It only ensures that your code is free of syntax errors.The most common three validators you’ll use are: In this Web Standards Curriculum article, we will cover how to use the first two of these, showing you how to validate markup, interpreting the typical kinds of results the validator gives you.The link checker is very obvious, and we'll cover debugging CSs later on in the course.However, there are compelling reasons why you should make every effort to learn HTML- and CSS-valid standards, and comply with them.It's There's a W3C validator for mobile devices as well.

What is the best way to start finding out what is wrong, and ensure that these pages (and any future pages you write) will be displayed properly across browsers, with no errors? There are many tools available, from the W3C and other places, that allow you to validate the code on your sites.Although web browsers will accept bad (invalid is the official term) web pages and do their best to render the code by making a best guess of the author’s intention, it is still possible to check whether the HTML has been written correctly, and indeed it is a good idea to do so, as you’ll see below. The validation program compares the HTML code in the web page with the rules of the accompanying doctype and tells you if and where those rules have been broken.There is a common feeling amongst some web developers that if a web page looks fine in browsers, it doesn’t matter if it doesn’t validate.These technologies, which we call "web standards," are carefully designed to deliver the greatest benefits to the greatest number of web users while ensuring the long-term viability of any document published on the Web.— Web Standards Group Even the most proficient Web designers sometimes fail to validate their documents — checking a Web document against the existing, DOCTYPE-specific technical specifications. HTML and CSS validation does not guarantee perfect Web documents, and some truly heinous Web sites can be designed that are completely valid.As Roger Johannson writes: Note that "works in any web browser" does not mean "looks the same in every web browser." Making a document look identical across browsers and platforms is next to impossible.

775

Leave a Reply