CSS : Coding standards







  Sample of the pdf document:





1- CSS file location

All CSS files should be placed within the directory:

/includes/css/

Within this location, individual CSS files should be split up depending on whether they are for the live site or content management system:

/includes/css/cms/
/includes/css/site/

Within each of these directories, there should be a main stylesheet named global.css, along with a stylesheet named print.css.  This print stylesheet acts as a stopper for Windows Internet Explorer 5 & 5.5, to fix a CSS parsing bug.  The real print CSS styles should be included in a file called actualprint.css.  Finally, an empty CSS file called null.css should also be included to stop any server log errors being reported. 

2 – Coding conventions

2.1 - CSS style

Always use consistent styling when writing the CSS styles. Always set each element declaration on a separate line, with all styles being tabbed once underneath.  Always insert a space before and after the separating colon.


2.2 - CSS ordering

The general order of rules within a CSS statement, can be split into two blocks. Everything at the top should be container related, while the bottom should be font/text related. The general layout should be:


Anything else should go underneath border, but above the font rules.

2.3 - General tips

 - Always code everything in lowercase.
 - Don’t use hyphens.
 - Don’t use underscores.
 - Comment all styles that may not appear to be necessary.
 - Use consistent spacing throughout the CSS document – look at the latest examples to see how this should be applied. ...........








Click here for  Download PDF / FREE
     

0 commentaires: