Oct 29, 2009

Margin and padding

This article will guide you to familiarize yourself with margin and padding, alignment and watch buffer.
To have a nice blog we have to edit the source code for the components become balanced and harmonious.
What is MARGIN ?
Margin is used to control the space between the components of the page
How to use it ?
Go to Edit HTML, drag the first down and you can see a lot of ingredients margin with different values. Depending on the number of values that stand behind the different spaces. You can see 4, 3, 2, or even one worth standing behind.
Examples:
Four values:
margin 2px 7px 0 1px;
Margin above, right, bottom, left to be cultivated according to the distance turn 2px, 7px, 0px, 1px
Three values:
margin: 12px 15px 7px;
Margin above, right, bottom, left to be cultivated according to the distance turn 12px, 15px, 7px, 15px
Two values:
margin: 8px 4px;
Upper and lower margin: 8px
Left and right margin: 4px
A value:
margin: 10px;
All margins are farming a distance 10px
If you do not remember these positions, please use the following syntax for each position one.
margin-top: 2px;
margin-right: 3px;
margin-bottom: 5px;
margin-left: 4px;
What is PADDING ?
Padding used to control the gap between content and its border
How to use it ?
Similar margin, padding may be worth going back four, respectively on, right, bottom, left (ie clockwise).
Examples:
padding: 15px 30px 25px 0;
On 15px, not 30px, bottom 25px, left 0px
Also we can use:
padding-top: 2px;
padding-right: 6px;
padding-bottom: 0;
padding-left: 8px;

No comments:

Post a Comment