Tutorials All - Webdesign, Graphic Design

Visit our new Webdesign Templates,css,html5 etc

Download New Android Applications

Visit our new Collections of Android Application

28.2.11

Principles for keeping your code clean

The art of writing HTML and CSS is the foundation of a beautiful website. The advantages of clean, semantic HTML are many, but so many websites suffer from poorly written markup.

Most of the attractive website have beautiful designs but fails to pass in the w3c validations. This is because of bad coding. These are the basic and most follow principles for keeping your code clean and have a semantic structure. They are as follows...

1. Strict DOCTYPE
2. Proper indentation
3. Nest your tags properly
4. Character set & encoding characters
5. Eliminate unnecessary divs
6. Use better naming conventions
7. Leave typography to the CSS
8. Use Class/id the body tag
9. Keep your CSS and JavaScript external
10. Validation

This will be a great start to write clean HTML, but there is still lots more. When starting from scratch, this seems to be much easier. When trying to fix existing code, it feels a lot more difficult. SO from the next project, just think what you can make it right.

0 comments:

Post a Comment