HOME
          About US
          Contact Us

Padding in CSS

Chapter - 20 : Borders and Dimensions (Padding in CSS): (Page 6/6)


(Cotinued from previous page)

iii)For individual sides: in this case the padding may be different for all 4 sides
padding -top:1px; padding -right:2px;
padding -bottom:3px; padding -left:4px;
in this case the padding is different for all 4 sides



iv) Padding Commands: The CSS also allows defining the padding for 4 sides in one line or in the combinations of two sides. In all the following cases the sequence and combination is fixed as defined below

a) All four sides padding defined
padding:1px 2px 3px 4px;
The web browser will take sequence as top - right - bottom - left

b) Only three padding are defined
padding:1px 2px 3px;
The web browser will take 1st value for top, 2d value for left and right and 3rd value for bottom

c) Only two padding are defined
padding:1px 2px;
The web browser will take 1st value for top & bottom and 2d value for left and right

Padding in CSS © funandhobby.com (Padding in CSS)