IE8 input type image shows border even when I set the border to none

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

input[type=image] {
    margin: 0px; 
    padding: 0px;
    border: none;
    border-width: 0px;
    border-style: none;
    background-color: none;
}
+3
source share
3 answers

IE does not support this selector very consistently in my experience; enter the input class and then use it instead.

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

input.imageinput {
    margin: 0px; 
    padding: 0px;
    border: none;
    background-color: none;
}
0
source

Use the outlineCSS property :

input[type="image"] {
    border: none;
    outline: none;
}

outline , , IE8 . W3Schools.

+5

First of all, thanks for asking this question. I ran into this problem a year ago, you can choose what you need, but what I did was just import this CSS as a starting point in my .css style and because of this it does not give me an undesirable result

/* Reset CSS */

body, html {
    height:100%;
}
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, font, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td {
    border:0;
    outline:0;
    font-size:100%;
    vertical-align:baseline;
    background:transparent;
    margin:0;
    padding:0;
}
body {
    line-height:1;
}
ol, ul {
    list-style:none;
}
blockquote, q {
    quotes:none;
}
blockquote:before, blockquote:after, q:before, q:after {
    content:none;
}
:focus {
    outline:0;
}
del {
    text-decoration:line-through;
}
table {
    border-collapse:collapse;
    border-spacing:0;
}

/* Floating & Alignment  */

.fl {
    float:left;
}
.fr {
    float:right;
}
.ac {
    text-align:center;
}
.ar {
    text-align:right;
}

/* Clear Floats  */

.col-full:after {
    content:".";
    display:block;
    height:0;
    clear:both;
    visibility:hidden;
}
.fix {
    clear:both;
    height:1px;
    overflow:hidden;
    margin:-1px 0 0;
}
html body * span.clear, html body * div.clear, html body * li.clear, html body * dd.clear {
    background:none;
    border:0;
    clear:both;
    display:block;
    float:none;
    font-size:0;
    list-style:none;
    overflow:hidden;
    visibility:hidden;
    width:0;
    height:0;
    margin:0;
    padding:0;
}

If you keep the habit of importing this css, it will never provide you with an undesirable result in any browser.

Thank!

+1
source

Source: https://habr.com/ru/post/1730168/


All Articles