开发者

hr has a black pixel underneath it?

开发者 https://www.devze.com 2023-03-01 16:22 出处:网络
We have a hr line and there is a weird black pixel underneath it. Screenshot: http://i52.tinypic.com/2vwxy78.jpg

We have a hr line and there is a weird black pixel underneath it.

Screenshot: http://i52.tinypic.com/2vwxy78.jpg

Our code:

HTML:

<hr />

CSS:

hr {
    border-bottom: 1px solid #FFFFFF;
    border-top: 1开发者_如何学JAVApx solid #AAAAAA;
    clear: both;
    height: 0;
    margin: 12px 0 18px;
}

Browser: Firefox

Why is this pixel appearing underneath the <hr />? How do we fix this?


You need to reset all the border properties for the <hr>. Particularly the left border in your case. So:

border: 0;
border-bottom: 1px solid #FFFFFF;
border-top: 1px solid #AAAAAA;
....

Check it out - http://jsfiddle.net/uwed3/


You haven't removed the default style on the <hr> element.

Add this to your CSS:

border-left: 0;

And you should be fixed.

0

精彩评论

暂无评论...
验证码 换一张
取 消