Simplify CSS Property code, you can make the size of the CSS file smaller, faster reading speed, maintainability is higher.
The following are examples of the most common ways to simplify CSS Property code:
Margin
margin-top:1px;
margin-right:1px;
margin-bottom:1px;
margin-left:1px;
Code simplification to: margin:1px
margin-top:1px;
margin-right:2px;
margin-bottom:1px;
margin-left:2px;
Code simplified to: margin:1px 2px
margin-top:1px;
margin-right:2px;
margin-bottom:3px;
margin-left:2px;
Code simplified to: margin:1px 2px 3px
margin-top:1px;
margin-right:2px;
margin-bottom:3px;
margin-left:4px;
Code simplified to: margin:1px 2px 3px 4px
When the property value is 0, the unit can not write such as: 0px directly written as 0
Padding
Padding's writing method is the same as that of margin, where there is no more narration.
Border
border-width:1px;
Border-style:solid;
Border-color: #000000;
Code simplification is: border:1px solid #000
Background
Background-color: #CCFFFF;
Background-image:url (picture path);
Background-repeat:repeat-x;
background-position:5px 4px;
Code simplified to: background: #CFF URL (picture path) repeat-x 5px 4px
Font
font-size:26px;
Font-weight:bold;
Font-family: "The song Body";
Code simplification: font:26px bold "XXFarEastFont-Arial"
Color Property value
Color: #000000;
Color: #ff0000;
Code simplification to: color: #000, color: #f00