Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Div's with same content and same style have different dashed borders [duplicate]

Tags:

html

css

firefox

So I created a pen about it, as you see the first div has border-bottom and the second border-top. But the second div's border is different than first's.

http://codepen.io/Chrez/pen/meRxBW

<div class="first"></div>
<div class="second"></div>

Screenshot in Firefox:

Firefox screenshot

like image 628
Chrez Avatar asked Dec 04 '25 02:12

Chrez


1 Answers

That's going to be a rendering issue from your browser. It looks like it's working fine in Chrome but latest Firefox and IE are showing different borders like you said.

If you really must have it fixed I would recommend using pseudo elements with their border-top parameters set to the same value.

.first:after{
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    border-top:1px dashed #FFFFFF;
    height: 1px;
}

http://jsfiddle.net/st9uesqd/

like image 59
Nate Avatar answered Dec 05 '25 17:12

Nate



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!