Phone and FAX
Tel: 0845 121 1194
Fax: 0845 121 1195
Archives:
Meta:
Categories:
CSS Master Files - November 18, 2008
Whenever you start playing seriously with CSS you will notice that there are a lot of differences in the way pages render in different browsers. One of the more useful tips that was given to me when I was starting out is to use a master CSS file that resets default properties so all browsers have the same starting point. You can then use another CSS file to make it look pretty. These master CSS files can be found online all over the Internet.
But the problem with this approach is that these ‘master’ CSS files are often huge behemoths that systematically go through every possible element and make them all exactly the same.. It works but can be seen as using a sledge hammer to hang a picture. Perhaps a more appropriate approach is to use a cut down version that only goes through the elements used on the page. Every time you add a new type of HTML element, you add in the relevant CSS into your master CSS file that resets the padding, margin, colours, font weight etc of that element.
So, in general, master CSS files are a great idea, but can mean there is a lot of redundant and unused code. Just make sure you go through the file after you’re done to remove any unneeded CSS elements.
daviess at 5:35 pm
No Comments
No comments yet.