代码之家  ›  专栏  ›  技术社区  ›  Kelvin

CSS按钮滑动门技术,IE8问题

  •  1
  • Kelvin  · 技术社区  · 15 年前

    我使用滑动门技术,解释如下:

    http://www.oscaralexander.com/tutorials/how-to-make-sexy-buttons-with-css.html

    除了一个例外,我决定为“悬停”效果再添加一个图像。

    我的代码适用于所有浏览器,除了IE8(或者更早的版本)。

    A.提交按钮:激活 A.提交按钮:活动范围 只是被“悬停”所阻挡,永远不会工作。

    有人知道解决这个问题的方法吗?

    这是测试页: http://websvit.com/temp/button.html

    提前多谢!

    <style type="text/css">
    
    .clear { /* generic container (i.e. div) for floating buttons */
        overflow: hidden;
        width: 100%;
    }
    
    a.submit-button {
        background: transparent url('images/button-1b.png') no-repeat scroll top right;
        color: #fff;
        display: block;
        float: left;
        font: bold 13px sans-serif, arial;
        height: 28px;
        margin-right: 6px;
        padding-right: 18px; /* sliding doors padding */
        text-decoration: none;
        outline: none;
    }
    
    a.submit-button span {
        background: transparent url('images/button-1a.png') no-repeat;
        display: block;
        line-height: 14px;
        padding: 6px 0 8px 24px;
    } 
    
    a.submit-button:hover {
        background-position: right -28px;
        outline: none;  /* hide dotted outline in Firefox */
        color: #fff;
    }
    a.submit-button:hover span {
        background-position: 0px -28px;
    } 
    
    a.submit-button:active {
        background-position: right -56px;
        color: #e5e5e5;
        outline: none;
    }
    a.submit-button:active span {
        background-position: 0px -56px;
        padding: 7px 0 7px 24px; /* push text down 1px */
    } 
    
    </style>
    

    这是按钮:

    <div class="clear">
    <a class="submit-button" href="#" onclick="this.blur();"><span>Hello All</span></a>
    </div>
    

    alt text http://websvit.com/temp/button-1a.png alt text http://websvit.com/temp/button-1b.png

    1 回复  |  直到 15 年前
        1
  •  1
  •   Joel Crawford-Smith    15 年前

    所有的浏览器,除了IE8(或者更早的版本)。

    我查过了,你的长官在IE7。 IE6的性能很好,但是你有麻烦的PNG透明度问题。

    您可以尝试使用:focus伪类。IE8可能会尊重不尊重的地方:积极。