Reputation: 917
The following code renders as expected in Firefox and Chrome browsers, but on Safari it renders with an unwanted white line between the borders.
HTML:
<span>Text here</span>
CSS:
span {
border-top: 3.3em solid #ff9933;
border-right: 3.3em solid #ff9933;
border-bottom: 3.3em solid #ff9933;
border-left: 3.3em solid transparent;
color: white;
display: inline-block;
font-size: 1em;
line-height: 0;
}
Firefox and Chrome:
Safari:
Does anybody know why this is happening?
Upvotes: 4
Views: 3262
Reputation: 11
It seems like a problem of proportion, the border 3.3em can't cover totally the text with font-size 1em; you can change the border for 3.5em or you can change the font-size for 0.8em.
span {
border-top: 3.3em solid #ff9933;
border-right: 3.3em solid #ff9933;
border-bottom: 3.3em solid #ff9933;
border-left: 3.3em solid transparent;
color: white;
display: inline-block;
font-size: 0.8em;
line-height: 0;
}
<span>Text here</span>
Upvotes: 1
Reputation: 18997
Looks like Safari finds your line height (if zero line height can be called height :)) unsatisfactory for such a small border. Does work fine with 3.5em
.
span {
border-top: 3.5em solid #ff9933;
border-right: 3.5em solid #ff9933;
border-bottom: 3.5em solid #ff9933;
border-left: 3.5em solid transparent;
color: white;
display: inline-block;
font-size: 1em;
line-height: 0;
}
<span>Text here</span>
Upvotes: 0