|
|||||
| | |||||
The 'margin' property puts half an em of space above and below the rule and makes the right margin 60% (of the parent's width). The line is therefore 40% of the parent's width long.
Here is another solution, that creates a black rectangle by using the 'background' and 'height' properties.
HR {margin: 0.5em 60% 0.5em 0;
height: 0.04em;
background: black}
The black rectangle is 0.04em high and has a width of 40% of the parent's width.
| Leave a Reply |