HowToPlaza.com

How to wisdom from across the Internet — want to know how to do something? You may find the solution here.


How to organize your cascading style sheet code

Working with cascading style sheets can become addictive after some time especially when with just a few lines you can completely change the entire look of your website whether it has 5 pages of 5000 pages.

Since almost every component of your website can be defined in the CSS (cascading style sheet) file in no time you will have a huge CSS file and keeping track of individual components it will become an uphill task. If you’re just beginning to create your CSS file it is better to follow a methodology and use comments wherever possible so that you know what is happening where in your CSS file.

Another good practice is to keep the code of various components together. If there is div and the div has various components in it like <h3>, <p>, <li> etc. then keep their definitions together under a single commented block,  something like

/* Code for sidebar begins */
#div{
}
#div h3{
}
#div p{
}
#div li{
}
*/ Code for sidebar ends */

You can find more such tips at Webcredeible.

AddThis Social Bookmark Button

Posted by admin | Tags: Uncategorized


You can leave a response, or trackback from your own site.

Leave a Reply