CSS below margin, padding, border, background and font abbreviations sample _ Experience Exchange

Source: Internet
Author: User
Here's an example of some of the more commonly used properties.

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

Note: When the property value is 0, the unit can not write as: 0px directly written 0

Padding

The writing method of padding is similar to margin

padding-top:1px;
padding-right:1px;
padding-bottom:1px;
padding-left:1px;
Code simplification to: padding:1px

padding-top:1px;
padding-right:2px;
padding-bottom:1px;
padding-left:2px;
Code simplified to: padding:1px 2px

padding-top:1px;
padding-right:2px;
padding-bottom:3px;
padding-left:2px;
Code simplified to: padding:1px 2px 3px

padding-top:1px;
padding-right:2px;
padding-bottom:3px;
padding-left:4px;
Code simplified to: padding:1px 2px 3px 4px

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
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.