CSS Shorthand Properties
By Trenton Moss2008-01-26
One of the main advantages of using CSS is the large reduction in web page download time. To style text, you used to have to use the <font>
tag over and over again. You probably also laid out your site with
tables, nested tables and spacer gifs. Now all that presentational
information can be placed in one CSS document, with each command listed just once.
But why stop there? By using CSS shorthand properties you can reduce the size of your CSS document even more.
Font
Use:
font: 1em/1.5em bold italic serif
...instead of
font-size: 1em;
line-height: 1.5em;
font-weight: bold;
font-style: italic;
font-family: serif
This CSS shorthand property will only work if you're specifying both the font-size and the font-family - omit either and the CSS rule will be completely ignored. Also, if you don't specify the font-weight, font-style, or font-varient then these values will automatically default to a value of normal, so do bear this in mind too.
Tutorial pages:
|
|
|||||||||
You might also want to check these out:
|
Link to This Tutorial Page!

