CSS/Properties/margin-right
From W3C Wiki
< CSS | Properties
Contents |
margin-right
The margin-right property sets the right margin of a box.
Description
| Values | [<length> | <percentage> | auto] | inherit |
|---|---|
| Initial value | 0 |
| Applies to | all elements except elements with table display types other than table-caption, table and inline-table |
| Inherited | No |
Values
<length>
<percentage>
auto
inherit
Takes the same specified value as the property for the element's parent.
Example
Example A
[style.css]
#body{
background-color: #666;
}
p{
background-color: #ccc;
}
#mar{
margin-top: 50px;
margin-right: 10px;
margin-bottom: 50px;
margin-left: 10px;
}
[index.html]
<body> <p>This is a paragraph</p> <p id="mar">This is a paragraph</p> <p>This is a paragraph</p> <p>This is a paragraph</p> </body>
CSS Reference
The CSS specification defines the margin-right property in 8.3 Margin properties.

