22. Testing and Debugging Web Pages
So, you've written up a brand new page and you fire up your browser only to find that it doesn't look anything like you expected. Or it doesn't display at all. Or maybe it looks great in your default browser but when you call your client she says it looks, well, kind of funny on her computer.
Between HTML, XHTML, CSS and the multitude of browsers and platforms on which you can view them, it's easy to have a bit of trouble. This chapter will alert you to some common errors, and will also help you weed out your own homegrown variety.
Some of the debugging techniques may seem pretty basic. The thing is that most problems with Web pages are pretty basic, too. Before you go looking for a big problem, make sure you don't have any little ones. I'll show you how in the first section.
Once your code is correct, you should then thoroughly test your site on one or more browsers, in one or more platforms, to see if each page works the way you want it to.
|Some Debugging Techniques|
|Check the Easy Stuff First!|
|Checking the Easy Stuff: HTML|
|Checking the Easy Stuff: XHTML|
|Checking the Easy Stuff: CSS|
|Validating Your Code|
|Testing Your Page|
|When the Browser Displays the Code|
|When Images Don't Appear|
|Differences from Browser to Browser|