Thursday, August 21, 2008

css shorthand please!

I recently saw an article about using css shorthand I began to wonder if anyone was really not using shorthand for their css documents. I cant say for sure but it seems to save a lot of time overall. It is not that complicated either. for instance:

#wrapper{
margin-top: 5px;
margin-right: 4px;
margin-bottom: 3px;
margin-left: 2px;
}
becomes

#wrapper {
margin: 5px 4px 3px 2px;
}

also if the top two margins are the same, as the side tto are, you could do it like this:

#wrapper {
margin: 5px 4px;
(that would be 5px from the top and bottom, and 4px from each the left and right)
so if any one is till writing each of these seperatley hopefully they will now take advantage of the shorthand!

No comments: