Background color on input type=button :hover state sticks in IE

前端 未结 3 1599
抹茶落季
抹茶落季 2021-01-02 10:34

I have an input type=button with a background color set and a different one on :hover - see http://jsfiddle.net/hc2Eu/3/

In IE (all versions) - when I mouse down on

3条回答
  •  没有蜡笔的小新
    2021-01-02 11:14

    There might be a fix to - but if there is, I don't know it.

    Otherwise, a good option seems to be to replace it with a carefully styled a element.

    Example: http://jsfiddle.net/Uka5v/

    .button {
        background-color: #E3E1B8; 
        padding: 2px 4px;
        font: 13px sans-serif;
        text-decoration: none;
        border: 1px solid #000;
        border-color: #aaa #444 #444 #aaa;
        color: #000
    }
    

    Upsides include that the a element will style consistently between different (older) versions of Internet Explorer without any extra work, and I think my link looks nicer than that button :)

提交回复
热议问题