padding-right
La propietat CSS padding-right
estableix l'amplada de l'àrea de farcit a la part dreta d'un element. A diferència dels marges, no es permeten valors negatius per al farcit . La propietat abreujada padding
es pot utilitzar per establir farcits als quatre costats d'un element amb una sola declaració.
/* <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;
L'àrea de farcit d'un element és l'espai entre el seu contingut i la seva vora.
Initial value (en-US) | 0 |
---|---|
Applies to | all elements, except table-row-group , table-header-group , table-footer-group , table-row , table-column-group and table-column . It also applies to ::first-letter and ::first-line . |
Inherited (en-US) | no |
Percentages | refer to the width of the containing block |
Computed value (en-US) | the percentage as specified or the absolute length |
Animation type | a length |
Sintaxi
Valors
length
(en-US)- La grandària del farcit com a valor fix. Ha de ser no negatiu.
percentage
(en-US)- La grandària del farcit com a percentatge, en relació amb l'amplada del bloc contenidor. Ha de ser no negatiu.
Sintaxi formal
Exemples
.content { padding-right: 5%; }
.sidebox { padding-right: 10px; }
Especificacions
Especificació | Estat | Comentari |
---|---|---|
CSS Basic Box Model The definition of 'padding-right' in that specification. |
Candidate Recommendation | No hi ha cap canvi. |
CSS Transitions The definition of 'padding-right' in that specification. |
Working Draft | Defineix padding-right com animable. |
CSS Level 2 (Revision 1) The definition of 'padding-right' in that specification. |
Recommendation | No hi ha cap canvi. |
CSS Level 1 The definition of 'padding-right' in that specification. |
Recommendation | Definició inicial. |
Navegadors compatibles
We're converting our compatibility data into a machine-readable JSON format.
This compatibility table still uses the old format,
because we haven't yet converted the data it contains.
Find out how you can help! (en-US)
Descripció | Chrome | Edge | Firefox (Gecko) | Internet Explorer | Opera | Safari (WebKit) |
---|---|---|---|---|---|---|
Suport bàsic | 1.0 | (Yes) | 1.0 (1.0) | 4.0 | 3.5 | 1.0 (85) |
Descripció | Android | Edge | Firefox Mobile (Gecko) | IE Phone | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|---|
Suport bàsic | ? | (Yes) | ? | ? | ? | ? |
Vegeu també
- Model de caixa CSS
- La propietat abreujada
padding
es pot utilitzar per establir el farcit en els quatre costats d'un element amb una sola declaració:padding-top
,padding-right
,padding-bottom
ipadding-left
.