This blog explains about the short hand properties in CSS
CSS Shorthand Guide
Below are the few of the CSS properties that contains shortcuts,
Background:
The syntax for declaring the background normal & shorthand values are as follows:
Normal Background Property
.Element
{
background-color: color || #hex || (rgb / % || 0-255);
background-image:url(path);
background-repeat: repeat || repeat-x || repeat-y || no-repeat;
background-position: X Y || (top||bottom||center) (left||right||center);
background-attachment: scroll || fixed;
}
Shorthand Background property
.Element
{
background: color image repeat position attachment;
}
Font:
The syntax for declaring the font normal & shorthand values are as follows:
Normal Font Property
.Element
{
font-style: normal || italic || oblique;
font-variant:normal || small-caps;
font-weight: normal || bold || bolder || || lighter || (100-900);
font-size: (number+unit) || (xx-small - xx-large);
line-height: normal || (number+unit);
"more names";
}
Shorthand Font Property
.Element
{
font: style variant weight size line-height family;
}
Border:
The syntax for declaring the border normal & shorthand values are as follows:
Normal border Property
.Element {
border-width: number+unit;
border-style: (numerous);
border-color: color || #hex || (rgb / % || 0-255);
}
Shorthand border Property
.Element
{
Border: width style color;
The syntax for declaring the margin normal & shorthand values are as follows:
Normal margin Property
.Element
{
margin-top: number+unit;
margin-right: number+unit;
margin-bottom: number+unit;
margin-left: number+unit;
}
Shorthand margin Property
.Element
{
Margin: top right bottom left;
}
The same shorthand is applicable for PADDING property also.
Likewise the shorthand properties are available for List-style, Outline, page break etc..
Posted by: Kumar.V