Creating clean html


I just had a question about centering something on my site which I posted in the CSS forum. The responder was kind enough to both help me and point out some issues with the design of my site (for example, mixing javascript with html). First, what’s the importance of having a “clean design”? Is it so that the site is as searchable as possible? And if so, can someone give me either some basic guidelines or a website that will spell it our for me?

In particular, almost every one of my webpages has css, html, javascript, and php so I guess I need to really understand where each should piece be going.

Thanks so much,


There are so many devices that a web page can be viewed in, and so many ways those devices can be used (such as with JavaScript turned off) that it’s important to make your pages as adaptable to as many circumstances and environments as possible. For example, if your page depends on JS to work properly, all sorts of people will might suffer (those with JS off, some people using assistive technologies like screen readers).

There are principles such as ‘graceful degradation’ and ‘progressive enhancement’ to explain good web design principles. Here’s one article in that:

A List Apart: Articles: Understanding Progressive Enhancement


Thanks for the article…it has some good “overall concepts” — if there are other ideas from folks about other “cleanliness issues” I’d love to hear them!

Clean and tidy HTML has several benefits.

First, it’s much easier to work with. If you’re editing a page, or asking someone else for help, you’ll find it much easier if the page is well-written, elements are used correctly, everything is laid out neatly and consistently, and repeated blocks, scripts and styles are externalised.

Second, it helps you to write better code if you can clearly see what you’re doing. At one level, this makes it less likely that you’ll make a mistake - sometimes mistakes will affect the rendering in some browsers but not others, so if you just do a visual check in one browser you might not pick them up. At the next level, it can help your site to run quicker, use less bandwidth and be more search-friendly.


Thank you for your input; it’s very much appreciated! Might you have any sources that could give me examples of the “do’s and don’ts”; for example, at the very least, I know that it’s better to have external CSS style sheets and to do table formatting with CSS.

Thanks again…