Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use padding attribute to define intra-edge blanking in CSS

2025-04-08 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)05/31 Report--

In this article Xiaobian for you a detailed introduction of "CSS how to use the padding attribute definition edge whiteout", detailed content, clear steps, details handled properly, I hope that this "CSS how to use padding attribute definition edge whitefilling" article can help you solve doubts, the following follow the editor's ideas slowly in-depth, together to learn new knowledge bar.

CSS padding attribute defines intra-edge padding

There can be a layer of padding on the inside of the border, which defines the distance between the border and the contents of the frame. The top in the edge is divided into the upper inner white (bottom), the lower inner white (bottom), the left inner white (left) and the right inner white (right).

There is only one attribute of width in the edge padding.

Padding-- defines intra-edge blanking

Value: {1Pie4} | inherit

{1pr 4}: the width of filling white inside the edge

Inherit: inheritance

Initial value: 0

Inheritance: no

For: all elements, except table-row-group,table-header-group,table-footer-group,table-row,table-column-group and table-column

◆ padding: blanking inside the edges

The value of padding-width

Length representation

Percentage representation, the padding percentage is calculated based on the width of the containing block of the generated box.

Auto: automatic

Tip: padding inner margin padding cannot be negative; it cannot be seen because it is transparent.

Example

◆ specifies a value for padding-width

Padding:padding-top/padding-right/padding-bottom/padding-left; p#onepaddings {padding:12px;}

All the internal blanks are 12px.

Equivalent to the following definition

P#onepaddings {padding-top-width:12px; padding-right-width:12px; padding-bottom-width:12px; padding-left-width:12px;}

◆ specifies two values for padding-width

Padding:padding-top/padding-bottompadding-right/padding-left; p#threepaddings {padding:12px5%;}

The top and bottom edges are 12px, and the left and right sides are 5% (relative to the whole page).

Equivalent to the following definition

P#threepaddings {padding-top-width:12px; padding-right-width:5%; padding-bottom-width:12px; padding-left-width:5%;} specifies three values for padding-width, padding:padding-toppadding-right/padding-leftpadding-bottom; p#threepaddings {padding:12px5%0;}

The top inner margin is 12px, the left and right inner margin is 5% (relative to the whole page), and the lower inner margin is 0.

Equivalent to the following definition

P#twopaddings {padding-top-width:12px; padding-right-width:5%; padding-bottom-width:0; padding-left-width:5%;} specifies four values for padding-width padding:padding-toppadding-rightpadding-bottompadding-left; p#fourpaddings {padding:12px5%-12pxauto;}

The top inner white space is 12px, the right inner white space is 5% (relative to the whole page), the lower inner white space is-12px, and the left inner white space will be automatically adjusted according to the browser.

If the padding attribute is followed by four values, the order in which the values are assigned is rotated clockwise from above.

Equivalent to the following definition

P#fourpaddings {padding-top-width:12px; padding-right-width:5%; padding-bottom-width:-12px; padding-left-width:auto } read here, this "how to use padding attribute definition in CSS" article has been introduced, want to master the knowledge of this article still need to practice and use in order to understand, if you want to know more about the article, welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report