Aaron Saray

open source programmer,
web developer

entrepreneur, author
and musician

My Blog

contains PHP, Web and business/entrepreneurial related content. Please join in the conversation!

Remove Internet Explorer Button Border

Internet Explorer provides an additional border to any BUTTON element in the page if you don’t explicitly assign a 0px border to it. i have a bunch of buttons on a design that I’d like to have a 1px #fff border on. Unfortunately, with the additional border that IE adds, it looks horrible.

The solution was to add a span around the button:

1
2
3
4
5
6
button {
border: 0px;
}
.button {
border: 1px solid #fff;
}
1
<span class="button"><button>My Button</button></span>

This entry was posted in CSS and tagged . Bookmark the permalink.

4 Responses to Remove Internet Explorer Button Border

  1. Good catch. I’ll be adding this to my future reset stylesheets.

  2. Benxamin says:

    Doesn’t quite work with buttons using the sliding doors method.

    Search

    It’s fine in WebKit/Mozilla, but I still get that damned border on the active state! We tried wrapping it in a span like you do, but it’s still a no go.

  3. Benxamin says:

    IE 6, IE 7 and IE 8 (running in compatibility as 7).

    We fixed it by adding another SPAN just inside the button. The first child of the BUTTON tends to receive the focus, so you can mask the effects with the styles on the second child.

    BUTTON begin-door
    SPAN (receives IE focus so your door doesn’t get the border)
    SPAN end-door
    TEXT
    /SPAN
    /SPAN
    /BUTTON

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>