CSS, How to use Shorthand Margins and Padding.

Margins create space between the edge of an element and the edge of any adjacent elements. Padding creates the space between the edge of the element and its content. The margin and padding shorthand properties also can be used to make CSS code more concise.

The margin property can combine margine-top, margin-right, margin-bottom, and margin-left. The padding property can combine padding-top, padding-right, padding-bottom, and padding-left.

The margin and padding properties also can be used to style different values for each side of an element. Values are applied in the follow order: top, right, bottom, and left – clockwise starting at the top.

The <p> element can be styled with padding-top, padding-right, padding-bottom, and padding-left or with a single padding property.

CSS Longhand

p {

color: maroon;
font: 80% arial, helvetica, sans-serif;
padding-top: 1em;
padding-right: 2em;
padding-bottom: 3em;
padding-left: 4em;

}

CSS ShortHand

p {

color: maroon;
font: 80% arial, helvetica, sans-serif;
padding: 1em 2em 3em 4em;

}

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