Sunday, 18 September 2011

Use Shorthand CSS

Shorthand CSS gives you a shorter way of writing your CSS codes, and most important of all – it makes the code clearner and easier to understand.

Instead of creating CSS like this

.header{
background-color: #fff;
background-image: url(image.gif);
background-repeat: no-repeat;
background-position: top left;
}
It can be short-handed into the following:

.header {
background: #fff url(image.gif) no-repeat top left
}

No comments:

Post a Comment