Remove 3D push effect on a button

前端 未结 8 1575
忘掉有多难
忘掉有多难 2020-12-06 16:27

I\'m trying to remove all effects on a HTML Button element. The HTML:

8条回答
  •  星月不相逢
    2020-12-06 16:49

    I had a similar experience, and was able to fix it in IE8, but not IE7. See it working here: http://jsfiddle.net/GmkVh/7/

    HTML:

    
    

    CSS:

    button {
        color:#fff;
        background:#000;
        border: none;
        outline:none;
        padding: 5px;
        cursor: pointer;
        height: 25px;
    }
    
    /* 
       It hits this state (at least in IE) as you're clicking it
       To offset the 1px left and 1px top it adds, subtract 1 from each, 
       then add 1 to the right and bottom to keep it the same width and height
    */
    button:focus:active {
        padding-top: 4px;
        padding-left: 4px;
        padding-right: 6px;
        padding-bottom: 6px;
        color: #ccc;
    }
    

提交回复
热议问题