Introduction to padding padding on CSS

Source: Internet
Author: User

Grammar:

padding: [<length> | <percentage>]{1,4}

Default value : see each individual property

applies to : all elements, except Table-row-group | Table-header-group | Table-footer-group | Table-column-group | Table-row outside

Inheritance : None

Animation : Yes

calculated values : see each independent property

related Properties : [Padding-top] | | [Padding-right] | | [Padding-bottom] | | [Padding-left]

Value:

    • <LENGTH>: Use length values to define the inner filler. Negative values are not allowed

    • <percentage>: Defines the inner filler in percent. In the horizontal (default) Writing mode, it is calculated with reference to its containing block width, and other cases refer to height. Negative values are not allowed

Description

retrieves or sets the internal margins of the four edges of an object.

    • If you provide all four parameter values, the top, right, bottom, and left orders are used for four edges.

    • If only one is provided, it will be used for all four sides.

    • If two is provided, the first one is for top, bottom, and second for left and right.

    • If three is supplied, the first one is used on, the second one is for left, right, and the third is for the next.

    • Non-substituted (non-replaced) inline elements can use this property to set the inner patches on the left and right sides, and to set the inner patches on the upper and lower sides, you must first make the object appear as a block-level or inline block-level.

    • The corresponding script attribute is padding.

Trbl

Extension: Margin,border

padding the value abbreviation

padding: 20px; = = padding: 20px 20px 20px 20px;

padding: 20px 10px; = = padding: 20px 10px 20px 10px;

padding: 20px 10px 30px = = padding: 20px 10px 30px 10px;

Opposite is equal, the latter is omitted; 4 faces are equal, only one is set

<! DOCTYPE html>
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.