views:

576

answers:

2

I have used input type image to display my custom style buttons, but for some reason IE8 shows border even when I set in CSS border to none. In other browsers it is not showing border at all.

input[type=image] {
    margin: 0px; 
    padding: 0px;
    border: none;
    border-width: 0px;
    border-style: none;
    background-color: none;
}
A: 

IE doesn't support that selector very consistently in my experience; give the input a class and then style it with that instead.

<input type="image" class="imageinput" name="whatever" />

input.imageinput {
    margin: 0px; 
    padding: 0px;
    border: none;
    background-color: none;
}
Mark B
you mean input.imageinput
vsync
Yes I did, thanks!
Mark B
IE8 which the OP is refering to, does support attribute selectors: http://www.quirksmode.org/css/contents.html#t13
naivists
Hi, thanx for answer, but it didn't help.
newbie
you can just use a normal button, but give it a background image via css selector...
vsync
@naivists When I say 'IE', I meant older versions too - it's been my experience that it's just easier to use a class for consistency across older browsers.
Mark B
@newbie There is no reason why it shouldn't work. Can you post your button HTML and your new css?
Mark B
There is nothing special around this element, I just don't understand why it doesnt work...
newbie