As the name implies shorthand, then summarize the CSS abbreviation knowledge points.
Why do I have to abbreviate CSS properties?
1, simplify the code. Some CSS property shorthand reduces CSS code and thus reduces the amount of bytes used in CSS files. Speed up page downloads and page loading.
2, optimize the CSS purpose. One of the CSS optimizations is to simplify the code abbreviation for the CSS Property code.
CSS style attribute word code shorthand optimization
(1) CSS text:
(2) CSS background:
Background-color: #F00; Background-image:url (image address); background-position:bottom;background-repeat:no-repeat; You can abbreviate the background CSS property to: Background: #F00 URL (image address) No-repeat bottom;
(3) CSS padding (CSS padding):
PADDING-TOP:5PX;PADDDING-RIGHT:20PX;PADDING-BOTTOM:10PX;PADDING-LEFT:15PX can be abbreviated as: padding:5px 20px 10px 15px; or padding-top:5px;padding-bottom:5px;padding-left:10px;padding-right:10px; abbreviated as: padding:5px 10px;
(4) CSS margins (CSS margin):
margin-top:5px; margin-right:20px;margin-bottom:10px;margin-left:15px; margin:5px 20px 10px 15px; or: margin-top:5px; margin-bottom:5px;margin-left:10px;margin-right:10px; abbreviated as: margin:5px 10px;
(5), CSS border:
border-top:1px solid #000, border-right:1px solid #000, border-bottom:1px solid #000; border-left:1px solid #000; can be abbreviated as: border:1px solid #000;
Second, the punctuation optimization:
Summary: Summarize the commonly used CSS abbreviation, hope in the future production practice more use and a lot of summary.
CSS optimized compression