Get the App
SLTechnology News&Howtos  ›  Development  › 

How to use Padding to fill in CSS

Shulou Source: shulou.com Published: 2022-06-01 06:34:42 10月03日 Update

This article mainly shows you "how to use Padding filling in CSS", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "how to use Padding filling in CSS" this article.

The CSS Padding attribute defines the space between the element border and the element content.

Padding (fill)

When the Padding (inner margin) of an element is cleared, the area that is "released" will be filled with the background color of the element.

Using the fill property alone, you can change the fill up and down. The acronym fill property can also be used, and everything changes once it changes.

Possible value

Value indicates that length defines a fixed fill (pixels, pt, em, etc.)% defines a fill using percentage values

Fill-single inside margin attribut

In CSS, it can specify different fills on different sides:

Example

Padding-top:25px

Padding-bottom:25px

Padding-right:50px

Padding-left:50px

Fill-abbreviation attribut

To shorten the code, it can populate all the properties specified in one property.

This is called an acronym attribute. The abbreviated property of all padding properties is "padding":

Example

Padding:25px 50px

Give it a try »

The Padding property, which can have one to four values.

Padding:25px 50px 75px 100px

The top is filled with 25px

The right fill is 50px

The bottom fill is 75px

The left fill is 100px

Padding:25px 50px 75px

The top is filled with 25px

Fill left and right with 50px

The bottom fill is 75px

Padding:25px 50px

Fill the top and bottom with 25px

Fill left and right with 50px

Padding:25px

All the padding is 25px.

All CSS fill properties

Property description padding uses abbreviated attributes to set all fill attributes in a declaration the bottom of the padding-bottom setting element fills the left of the padding-left setting element, the right of the padding-right setting element fills the top fill of the padding-top setting element above is all the content of the article "how to fill with Padding in CSS", thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Tags: Attributes elements content abbreviations articles different up and down examples learning help left and right middle finger middle finger code pixel area that is bottom easy to understand more Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Microsoft Linux Huawei Xiaomi MySQL