Reputation: 15006
I'm trying to style a border so that it consist of a
1px green line below a 1px white line
hr{
height: 1px;
border: 0;
background-color: #89a889;
border-bottom: 1px solid #fafafa;
}
this works in webkit, but firefox seems to include the border in the total height of the line. This makes the bottom border cover the green line. Whan can I do about this?
Upvotes: 3
Views: 1399
Reputation: 35064
You can set -moz-box-sizing: content-box; box-sizing: content-box;
. The UA stylesheet sets it to border-box sizing.
Upvotes: 1
Reputation: 40433
hr {
height: 0;
border: 0;
border-top: 1px solid #89a889;
border-bottom: 1px solid #fafafa;
}
Use two borders.
Alternatively, if you really want it to work with a background color, use box-sizing: content-box
to get Firefox to display an hr
with the normal CSS box model.
You may want to include other vendor prefixes.
hr {
height: 1px;
border: 0;
background-color: red;
border-bottom: 1px solid blue;
-moz-box-sizing: content-box;
}
Upvotes: 2