From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- files/zh-cn/web/css/padding-right/index.html | 144 +++++++++++++++++++++++++++ 1 file changed, 144 insertions(+) create mode 100644 files/zh-cn/web/css/padding-right/index.html (limited to 'files/zh-cn/web/css/padding-right/index.html') diff --git a/files/zh-cn/web/css/padding-right/index.html b/files/zh-cn/web/css/padding-right/index.html new file mode 100644 index 0000000000..77b17279d0 --- /dev/null +++ b/files/zh-cn/web/css/padding-right/index.html @@ -0,0 +1,144 @@ +--- +title: padding-right +slug: Web/CSS/padding-right +tags: + - CSS + - CSS 内边距 + - CSS 属性 +translation_of: Web/CSS/padding-right +--- +
{{CSSRef}}
+ +

CSS属性 padding-right 是指一个元素在内边距区域(padding area)中右边的宽度。内边距(padding)是指一个元素的内容和边框之间的区域。和外边距(margin)不同,内边距(padding)是不允许有负值的。内边距(padding)可以用四个值声明一个元素的四个方向的内边距(paddings),这是一种CSS缩写属性。

+ +
/* <length> values */
+padding-right: 0.5em;
+padding-right: 0;
+padding-right: 2cm;
+
+/* <percentage> value */
+padding-right: 10%;
+
+/* Global values */
+padding-right: inherit;
+padding-right: initial;
+padding-right: unset;
+
+ +

{{cssinfo}}

+ +

Syntax

+ +

Values

+ +
+
{{cssxref("length")}}
+
当内边距(padding)大小是一个固定单位数值的时候,一定不能为负数。
+
{{cssxref("percentage")}}
+
当内边距(padding)是一个百分比的时候, 百分比是和本身包含的元素的宽度有关的,同样一定不能为负数。
+
+ +

Formal syntax

+ +
{{csssyntax}}
+ +

Examples

+ +
.content { padding-right: 5%; }
+.sidebox { padding-right: 10px; }
+
+ +

Specifications

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{ SpecName('CSS3 Box', '#the-padding', 'padding-right') }}{{ Spec2('CSS3 Box') }}No change.
{{ SpecName('CSS3 Transitions', '#animatable-css', 'padding-right') }}{{ Spec2('CSS3 Transitions') }}Defines padding-right as animatable.
{{ SpecName('CSS2.1', 'box.html#padding-properties', 'padding-right') }}{{ Spec2('CSS2.1') }}No change.
{{ Specname('CSS1', '#padding-right', 'padding-right') }}{{ Spec2('CSS1') }}Initial definition.
+ +

Browser compatibility

+ +

{{CompatibilityTable}}

+ +
+ + + + + + + + + + + + + + + + + + + + + +
FeatureChromeEdgeFirefox (Gecko)Internet ExplorerOperaSafari (WebKit)
Basic support1.0{{CompatVersionUnknown}}1.0 (1.0)4.03.51.0 (85)
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
FeatureAndroidEdgeFirefox Mobile (Gecko)IE PhoneOpera MobileSafari Mobile
Basic support{{ CompatUnknown() }}{{CompatVersionUnknown}}{{ CompatUnknown() }}{{ CompatUnknown() }}{{ CompatUnknown() }}{{ CompatUnknown() }}
+
+ +

See also

+ + -- cgit v1.2.3-54-g00ecf