How to Css: Working with Padding

Padding can be applied to the outside edges of the content are of any block level or inline element. Padding creates the space between the edge of the element and its content.

Like margins, padding can be applied to individual sides of a box:

p {padding: 10px;}

h1{padding-top: 0px;}
h2{padding-right: 0px;}
h3{padding-left: 0px;}
h4{padding-bottom: 0px;}

Padding can also be applied using a single shorthand property. If one padding value is specified, it applies to all sieds of an element.

p {padding: 5px;}

If two values are specified, the top and bottom margines are set to the first value and the right and left margins are set to the second value.

p {padding: 5px 10px;}

If three values are specified, the top is set to the first value, the left and right to the second value and the bottom is set to the third value.

p {padding:5px 10px 0px}

If four values are specified, they apply to the top, right, bottom and left.

p {padding:5px 10px 3px 20px}

Helpful Articles

Trying to Lose Weight, Go Out With Friend And Family And Not Offend

This may sound amazing, but one of the hardest things to do when you are losing weight is to get the help of friends and family...

Top 10 Weight Loss Myths

Have you sometimes felt confused about weight loss and nutrition guides that should help you take the right decisions about your health, yet for some reason they don’t? Here are some of the most frequent weight loss theories, and their rebuttals...

How Do I Get Out Of A Weight Loss Plateau, Problem And Solution No. 2

When you ask the question “how do I get our of a weight loss plateau?” there can be more than one answer, depending on what the reason for the problem is...

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • BlinkList
  • blogmarks
  • email
  • Fark
  • LinkaGoGo
  • LinkedIn
  • Live
  • MySpace
  • StumbleUpon
  • Technorati
  • Twitter
  • Propeller
  • Yahoo! Buzz

Tags: , , ,

Leave a Reply