In this blog we will discuss about some best practices of CSS in SharePoint 2010.
Below are some CSS best practices to follow while using SharePoint 2010:
Validating your CSS is always important. This is to make sure that your CSS is error-free and is interpreted the right way in all browsers.
You can also validate through http://jigsaw.w3.org/css-validator/ URL.
Commenting code is always a best practice while working with any language. So it is always advertisable to give comment in css. You can comment like below:
/*this is css style comment*/
Naming is very much important. Naming classes according to their function rather than what they will look like is a best practice and the name should be meaningful.
it is a best practice to remove the white space from your .css fi les before you put the fi les in production. Smaller .css fi les will make your site load faster in the browser. You can use a CSS compressor like the one at the following URL to automatically remove the white space for you: http://cleancss.com.
SharePoint designer helps us to create custom css files.