Shortcuts
Grouping
If you have the same style for two or more selectors, you can group them!
p, h1, h2 {
font: 12px Arial, sans-serif;
}
Shorthand properties
I always use shorthand properties to have a lighter stylesheet. For example, if you have background properties set like this:
body {
background-color: #FFF;
background-image: url(image.jpg);
background-repeat: no-repeat;
}
The code can be shortened to one line:
body {
background: #FFF url(image.jpg) no-repeat;
}
Sponsors
Leave a Comment
Works? Doesn't work? Other tips? Please leave a comment! :)