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
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:
Hi harish... Update your blog regularly. One request, Plz change the link text as "How to start an internet business"
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.
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
Post a Comment
Subscribe to Post Comments [Atom]
<< Home