Thursday 19 April 2007

Reduce the size of your CSS file

I read an article about CSS today and it mentions the size of CSS files can be reduced by using some short statements. Some example here:

1)
border-width:1px;
border-style:solid;
border-color:#000;

simpler way=> border:1px solid #000;

2)

background-color:#f00;
background-image:url(background.gif);
background-repeat:no-repeat;
background-attachment:fixed;
background-position:0 0;

simpler way=> background:color image repeat attachment position;

3)

font-style:italic;
font-variant:small-caps;
font-weight:bold;
font-size:1em;
line-height:140%;
font-family:"Lucida Grande",sans-serif;

simpler way=> font:italic small-caps bold 1em/140% "Lucida Grande",sans-serif;

No comments: