Reputation: 391
I use a hr tag. It was working well, untl I gave the text a colored background. Now I see a white line under the black line. How to see only the black line?
div {
background-color: #eab126;
min-height: 100px;
}
hr {
height: 1px;
color: #fff;
}
<div>
Testing<br />
Testing<br />
<hr />
Testing<br />
Testing<br />
</div>
Upvotes: 2
Views: 1350
Reputation: 7984
To change the colour of the hr
you use border-color
not color
.
To change the height of the hr
manipulate the border width(s):
div {
background-color: #eab126;
min-height: 100px;
}
hr {
border-color: black;
border-top-width: 0px;
}
<div>
Testing<br /> Testing
<br />
<hr /> Testing
<br /> Testing
<br />
</div>
Upvotes: 0
Reputation: 731
You need to change the CSS for the hr
tag,
HTML 5 Boilerplate project in its default stylesheet specifies the following rule:
hr { display: block; height: 1px;
border: 0; border-top: 1px solid #ccc;
margin: 1em 0; padding: 0; }
div {
background-color: #eab126;
min-height: 100px;
}
hr {
display: block;
height: 1px;
border: 0;
border-top: 1px solid white;
margin: 1em 0;
padding: 0;
}
<div>
Testing<br /> Testing
<br />
<hr /> Testing
<br /> Testing
<br />
</div>
Upvotes: 2