Page 93 - Computer - 7
P. 93
The margin properties are described in the table given below.
Property Description Value(s) Example
Sets the bottom margin length
margin-bottom margin-bottom: 5px
of an element (default value 0px)
Sets the left margin of length
margin-left margin-left: 5px
an element (default value 0px)
Sets the right margin of length
margin-right margin-right: 2px
an element (default value 0px)
Sets the top margin of length
margin-top margin-top: 3px
an element (default value 0px)
margin-bottom,
Sets all margins of
margin an element in one margin-left, margin: 10px 5px
declaration margin-right, 5px 10px
margin-top,
Knowledge Discovery Subject Enrichment
You can set margin sizing using points (pt), pixels (px), millimeters (mm), centimeters (cm), inches (in),
picas (pc), x-height (ex), or em space (em).
You can specify the margin property in four ways. Consider the following examples:
• margin: 10px 5px 15px 20px
In the above code, top margin is 10px, right margin is 5px, bottom margin is 15px, and left margin
is 20px.
• margin: 10px 5px 15px
In the above code, top margin is 10px, right and left margins are 5px, and bottom margin is 15px.
• margin: 10px 5px
In the above code, top and bottom margins are 10px, and right and left margins are 5px.
• margin: 10px
In the above code, all four margins are 10px.
SETTING BORDER PROPERTIES
The Border properties are used to set the styles of the borders around an HTML element. You can
specify the width, style, and colour for the border.
91