Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Styling submit button with CSS for IE

For Firefox, and Chrome input[type=button]:hover,input[type=submit]:hover and input[type=button],input[type=submit] will do the job, but what to do with IE (8)?

@Herohtar: They do? How's that? I'm using this css and they won't work:

    input[type=button],input[type=submit]
{
    border-right-color: black;
    border-right-style: solid;
    border-right-width: 1px;
    border-left-color: black;
    border-left-style: solid;
    border-left-width: 1px;
    border-bottom-color: black;
    border-bottom-style: solid;
    border-bottom-width: 1px;
    border-top-color: black;
    border-top-style: solid;
    border-top-width: 1px;
    text-align: center;
    font-weight: bold;
    height: 30px;
    font-family: Georgia,'Times New Roman',times,serif;
    color: #000000;
    border-radius: 4px;
    -moz-border-radius:4px;
    -webkit-border-radius:4px;
    background: #fceabb; /* old browsers */
    background: -moz-linear-gradient(top, #fceabb 0%, #fccd4d 50%, #f8b500 51%, #fbdf93 100%); /* firefox */
    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#fceabb), color-stop(50%,#fccd4d), color-stop(51%,#f8b500), color-stop(100%,#fbdf93)); /* webkit */
    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#fceabb', endColorstr='#fbdf93',GradientType=0 ); /* ie */
}

input[type=button]:hover,input[type=submit]:hover
{
    color: black;   
    border-radius: 6px;
    -moz-border-radius:6px;
    -webkit-border-radius:6px;
    -khtml-border-radius:6px;
    background: #ffb76b; /* old browsers */
    background: -moz-linear-gradient(top, #ffb76b 0%, #ffa73d 50%, #ff7c00 51%, #ff7f04 100%); /* firefox */
    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffb76b), color-stop(50%,#ffa73d), color-stop(51%,#ff7c00), color-stop(100%,#ff7f04)); /* webkit */
    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffb76b', endColorstr='#ff7f04',GradientType=0 ); /* ie */
}
like image 244
guest86 Avatar asked Feb 26 '23 09:02

guest86


1 Answers

input[type=submit] and input[type=button] both work in IE8, as well as with the :hover condition.

Edit: The CSS you listed there works perfectly for me in IE8: http://jsfiddle.net/dnZNE/ Maybe something else in your CSS is overriding it?

like image 52
Herohtar Avatar answered Mar 23 '23 06:03

Herohtar