CSS Learning notes the definition and use of parameters in the padding attribute _ experience Exchange

Source: Internet
Author: User
It is always confusing to define the number of parameters in the padding attribute in CSS, for example:
body {padding:32px;}
body {padding:32px 24px;}
Body {padding:32px 24px 18px;}
Body {padding:32px 24px 18px 12px;}

Today, Baidu looks at the standard CSS documentation, which is defined as:
If only one is provided, it will be used for all four edges;
If two are supplied, the first one is used up-down and the second one is for left-right;
If three are supplied, the first one is used on, the second one is for left-right, and the third one is used for the next;
If you provide all four parameter values, the upper-right-bottom-left order is used for four-sided.
body {padding:36px;} 36px of patch margins on all sides of the object
body {padding:36px 24px;}
Top and bottom patch margins of 36px, left and right side of the patch margin of 24px
Body {padding:36px 24px 18px;}
The patch margins on the upper and lower sides are 36px and 18px respectively, and the patch margins on the left and right sides are 24px
Body {padding:36px 24px 18px 12px;}
Top, right, bottom, left patch margins are 36px, 24px, 18px, 12px, respectively

Make a mark, the watch forget.
  • 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.