Skip to main content

Beginner CSS: Padding & Margin

By Gary Larocque – March 5, 2010
Gary Larocque

Simple introduction to the CSS box model

Padding vs. Margin

Understanding padding and margins is an important concept for most CSS beginners. Mixing them up leads to incorrect usage which can trigger browser bugs and inconsistencies.

What Is Padding and Margin?

Padding is the inner space of an element which can be styled with a background while margin is the outer transparent space of an element. And in between is the elements border.

CSS Properties

  • padding-top: 0px;
  • padding-right: 0px;
  • padding-bottom: 0px;
  • padding-left: 0px;
  • margin-top: 0px;
  • margin-right: 0px;
  • margin-bottom: 0px;
  • margin-left: 0px;

CSS Shorthand Properties

  • padding: top right bottom left;
  • margin: top right bottom left;
 

About the author

Gary Larocque

Profeesional ServicesIGLOO Inc.

Gary Larocque is a member of the IGLOO Professional Services Team and has been a part of the IGLOO project since its infant stages. He has over ten years of experience in the field of Web…

0 Comments

Would you like to comment?

You must be a member. Sign In if you are already a member.

  • 1,483 views
  • $obj.VersionIndex versions
  • 0 comments
  • 0 followers
     
Avg. Rating:
Rating: 4out of5Igloo.Common.ObjectUserInfo
Post Date:
March 5, 2010
Posted By:
Gary Larocque

About this channel

  • 33,663 views
  • 50 articles
  • 68 followers
     

Viewed 1,483 times