IE8: weird border around HTML button element

Posted by s427 on Stack Overflow See other posts from Stack Overflow or by s427
Published on 2013-10-23T09:51:55Z Indexed on 2013/10/23 9:53 UTC
Read the original article Hit count: 194

Filed under:
|
|
|

I have a button element with a custom background (image+color) and no borders except for a 2px border-bottom (and a bunch of other properties --code below) which renders quite differently in Firefox and in IE8. The problem is, this is a work for a company that uses IE8 as their only browser, so it's important that the button renders well in IE8.

Here's a visual comparison between the two:

comparison FF/IE8

My question here is not about the padding difference (I'm looking into that), but about the weird border that is visible on IE8 in addition to the regular border (border-bottom).

Can anyone explain to me where it comes from and how to get rid of it?
Thanks in advance.

Here is the HTML code:

<button class="btn" id="c_edit">
    <span>Annuler</span>
</button>

And here is the CSS:

.btn {
    display: inline-block;
    margin: 0 0 7px 5px;
    padding: 0;
    color: #ddd;
    font-size: 14px;
    font-family: FrutigerLTStd55Roman, sans-serif;
    text-decoration: none;  
    border: none;
    border-bottom: 2px solid #222;
    background-color: #999;
    background-image: url('img/btn_bg.gif');
    background-position: 0 bottom;
    background-repeat: repeat-x;
    cursor: pointer;
    transition: all .5s ease-out;
}
.btn span {
    display: inline-block;
    margin: 0;
    padding: 8px 10px 6px 40px;
    background-color: transparent;
    background-position: 4px 0;
    background-repeat: no-repeat;
}

© Stack Overflow or respective owner

Related posts about html

Related posts about css