Contact Us

|

FriendFeed FriendFeed

|

follow us on twitter Twitter

|

 Rss Feed

|

Favorites Add to Favorites

Tuesday, May 29, 2007

Margins and Padding

Margin and Padding are the two most commonly used properties for spacing-out elements. A margin is the space outside of the element, whereas padding is the space inside the element.

Example:

.cp_list {
font-size: 14px;
background-color: #ffc;
margin: 10px 0px 5px 20px;
padding: 3px;
}

In this example (margin: 10px 0px 5px 20px;) which say the browser to leave space as top 10px, right 0px, bottom 5px and left 20px... and for padding which will alocate space 3px in all aspects..

The four sides of an element can also be set individually. margin-top, margin-right, margin-bottom, margin-left, padding-top, padding-right, padding-bottom and padding-left

3 Comments:

Blogger Idris said...

Hi harish... Update your blog regularly. One request, Plz change the link text as "How to start an internet business"

May 31, 2007 at 3:58:00 AM PDT  
Blogger ashok said...

Hi
Nice informative blog you got there we are into web designing www.evansia.co.in and are in chennai please do drop us a line we can think about helping each other.

November 22, 2007 at 4:01:00 AM PST  
Blogger Ukion said...

I try it on my blog.
very good post. Are you interested for link exchange. add comment to my link exchange section.
http://ukion.blogspot.com

Greetings my co-blogger

February 9, 2008 at 4:54:00 AM PST  

Post a Comment

Subscribe to Post Comments [Atom]

<< Home