0

我为我的网站创建了一个自定义按钮,在 chrome 中看起来不错

在此处输入图像描述

但在 IE 中它有白角

在此处输入图像描述

我已经尽我所能去除白角,但我不知道如何。

这是我在下面使用的样式:

   <input type="submit" value="Search" class="button1">

CSS规则是:

   .button1{
        height:26px;  font-size:12px;  font-weight:bold;   cursor:pointer; float:right;   
        padding-left:10px;   padding-right:10px;  margin:2px;  font-family:verdana,arial, helvetica, sans-serif; 
        border:1px solid #000;   border-width:1px;   float:left;
        -webkit-border-top-right-radius:    5px;    -moz-border-radius-topright:    5px;   border-top-right-radius:     5px;
        -webkit-border-bottom-right-radius: 5px;    -moz-border-radius-bottomright: 5px;   border-bottom-right-radius:  5px;
        -webkit-border-top-left-radius:     5px;    -moz-border-radius-topleft:     5px;   border-top-left-radius:      5px;
        -webkit-border-bottom-left-radius:  5px;    -moz-border-radius-bottomleft:  5px;   border-bottom-left-radius:   5px;
        background-color:#F00;
        background: rgb(254,255,232); /* Old browsers */
        background: -moz-linear-gradient(top,  rgba(254,255,232,1) 0%, rgba(214,219,191,1) 100%); /* FF3.6+ */
        background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(254,255,232,1)), 
            color-stop(100%,rgba(214,219,191,1))); /* Chrome,Safari4+ */
        background: -webkit-linear-gradient(top,  rgba(254,255,232,1) 0%,rgba(214,219,191,1) 100%); /* Chrome10+,Safari5.1+ */
        background: -o-linear-gradient(top,  rgba(254,255,232,1) 0%,rgba(214,219,191,1) 100%); /* Opera 11.10+ */
        background: -ms-linear-gradient(top,  rgba(254,255,232,1) 0%,rgba(214,219,191,1) 100%); /* IE10+ */
        background: linear-gradient(to bottom,  rgba(254,255,232,1) 0%,rgba(214,219,191,1) 100%); /* W3C */
        filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#feffe8', endColorstr='#d6dbbf',GradientType=0 ); /* IE6-9 */


    }
4

2 回答 2

2

这是这个问题的副本。

给出的解决方案建议添加一个包装器 div 来处理角落和 IE 无法混合和匹配。http://jsfiddle.net/UME84/

.corners {
    border:1px solid #000;
    border-radius:5px;
    margin:2px;
    overflow:hidden;
    float:left;
}

在 IE9 中测试。

于 2013-04-04T20:41:14.550 回答
1

对于 IE9-

<!--[if gte IE 9]><style type="text/css">.button1 {filter: none;}</style><![endif]-->

或者 border-radius:0px;在所有IE中设置

    <!--[if IE]>
       <style type="text/css">
        .button1 {
          filter:none;
          border-radius:none;
        }
       </style>
    <![endif]-->

CSS:

.button1{
        height:26px;cursor:pointer;
        padding-left:10px;
        padding-right:10px;
        margin:2px;
        font:bold 12px verdana,arial,helvetica,sans-serif;
        float:left;
        border:1px solid #000;
        border-radius:5px;
        background: #feffe8;
        background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2ZlZmZlOCIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiNkNmRiYmYiIHN0b3Atb3BhY2l0eT0iMSIvPgogIDwvbGluZWFyR3JhZGllbnQ+CiAgPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+);
        background: -moz-linear-gradient(top, #feffe8 0%, #d6dbbf 100%);
        background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#feffe8), color-stop(100%,#d6dbbf));
        background: -webkit-linear-gradient(top, #feffe8 0%,#d6dbbf 100%);
        background: -o-linear-gradient(top, #feffe8 0%,#d6dbbf 100%);
        background: -ms-linear-gradient(top, #feffe8 0%,#d6dbbf 100%);
        background: linear-gradient(to bottom, #feffe8 0%,#d6dbbf 100%);
        filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#feffe8', endColorstr='#d6dbbf',GradientType=0 )
}

PS:未经测试

请带上仍然使用 IE 的老 IE 用户下载Google Chrome Frame

于 2013-04-04T20:31:58.447 回答