CSS Padding

CSS Padding is similar to CSS Margin and part of the CSS Box Model.

Adding padding to an element will make the contents of that element move away from the outside of the element.

Take the following example:
The below div has absolutely no padding on it.

No padding

If we add 10 pixels padding:

10px padding

You can use shorthand of: padding: north east south west;, as an example: padding:5px 10px 5px 10px;, or just padding:10px; to apply to all sides.

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • email
  • FriendFeed
  • LinkedIn
  • Live
  • MSN Reporter
  • MySpace
  • PDF
  • Ping.fm
  • Posterous
  • Reddit
  • RSS
  • Slashdot
  • StumbleUpon
  • Suggest to Techmeme via Twitter
  • Technorati
  • Tumblr
  • Twitter
  • Yahoo! Bookmarks
  • Yahoo! Buzz
This entry was posted on Saturday, January 16th, 2010 at 10:50 pm and is filed under CSS Tutorials. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Post a Comment