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 Read more...
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 Read more...