- Shorthand properties are CSS properties that let you set the values of several other CSS properties simultaneously. Using a shorthand property, a Web developer can write more concise and often more readable style sheets, saving time and energy.
- Example:
li {
border-top-width: 1px;
border-top-style: solid;
border-top-color:#000000;
}
In shorthand:
border-top: 1px solid #000000;
- Example 2:
Padding: 0 5px 0 5px;
would translate to:
padding-top: 0px
padding-right: 5px
padding-bottom: 0px
padding-left: 5px