• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 12. Box Properties > padding Property

12.31. padding Property

The padding property exists as a type of “shortcut” property that allows Web authors to set the values that belong to padding-top, padding-bottom, padding-left and padding-right quickly and easily. As with all of the other properties in its sub-family, padding is used to add spacing between elements on a Web page.

This property can take from one to four separate numerical values, which set the width of the padding. The default unit is pixels, so if no measurement unit is specified, the value given is assumed to be a pixel value. If a single numerical value is present, all padding values are set to that value. If two numerical values are present, these padding values are passed on to the top and bottom, and the sides, respectively. If three values are present, the top, right and left, and then bottom take the numerical padding values specified. Finally, if four values are present, the top, right, bottom, then left sides take the numerical padding values specified. When specifying these values, they must be separated by a space, as can be seen in Listing 12.25. You can see the effects of the code in Listing 12.25 in Figure 12-32.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint