English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
padding-The right CSS attribute sets padding to the right, that is, the space between the right border and the content of the element. However, in many cases, the shorthand shorthand CSS attributepaddingEasier to use and more desirable.
The following table provides the usage instructions and version history of this attribute, as well as the usage syntax of this attribute in JavaScript scripts.
Default Value: | 0 |
---|---|
Applies to: | All elements except<tbody>,<thead>,<tfoot>,<tr>,<colgroup>and<col>. It also applies to::first-letter. |
Inheritance: | No |
An animatable property: | Yes.Please refer to Animation Attribute. |
Version: | CSS 1,2,3 |
JavaScript Syntax: | object.style.paddingRight="5em" |
The syntax of this attribute is as follows:
padding-right: length | percentage | initial | inherit
The following examples demonstrate how to use padding-right attribute.
h1 { padding-right: 2em; } p { padding-right: 50px; }Test to see‹/›
The following table describes the value of this attribute.
Value | Description |
---|---|
length | Values in units such as px, pt, cm, em, etc.; negative values are not allowed. |
percentage | Specify percentage padding. The percentage is calculated relative to the width of the element's containing block. Negative percentage values are not allowed. |
initial | Set this attribute to its default value. |
inherit | If specified, the associated element adopts the padding of its parent element.-right attribute values. |
padding-Browser Compatibility of the right attribute; the numbers in the table below represent the minimum version number of the browser that supports this attribute; all mainstream browsers support this attribute.
|
Please refer to the following tutorial:CSS Padding.
Related Attributes:padding,padding-top,padding-bottom,padding-left.