IE9:删除"脏"圆角

时间:2015-06-17 08:55:40

标签: css internet-explorer-9

此部分代码在菜单上绘制圆形边框。

在Chrome,IE11甚​​至是IE10中运行良好,但在IE9中存在一个问题:圆形边框是"脏" ...

enter image description here



.navsub {
    display: block;
    z-index: 999;
}
.navsub li {
    /*float: left;*/
    margin: 0px 2px;
    padding: 3px 5px;
    display: inline-block;
    border: 2px solid #fff;
    border-radius: 5px;
    z-index: 100;
    position: relative;
}
.navsub li:hover a, .navsub li.selected a {
    color: #fff;
}
.navsub li:hover, .navsub li.selected {    
    background: rgb(204, 0, 0);
    background: -moz-linear-gradient(top, rgb(204, 0, 0) 0%, rgb(170, 0, 0) 43%);
    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, rgb(204, 0, 0)), color-stop(43%, rgb(170, 0, 0)));
    background: -webkit-linear-gradient(top, rgb(204, 0, 0) 0%, rgb(170, 0, 0) 43%);
    background: -o-linear-gradient(top, rgb(204, 0, 0) 0%, rgb(170, 0, 0) 43%);
    background: -ms-linear-gradient(top, rgb(204, 0, 0) 0%, rgb(170, 0, 0) 43%);
    background: linear-gradient(to bottom, rgb(204, 0, 0) 0%, rgb(170, 0, 0) 43%);
    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#cc0000', endColorstr='#aa0000', GradientType=0);
    color: white;
}
.navsub li:hover::before, .navsub li.selected::before {
    border: solid;
    border-color: #A00000;
    border-width: 8px 10px 5px 4px;
    bottom: -3px;
    content:"";
    left: 10px;
    position: absolute;
    z-index: -1;
    -webkit-box-shadow: 3px 3px 5px -1px rgba(0, 0, 0, .3);
    box-shadow: 3px 3px 5px -1px rgba(0, 0, 0, .3);
    transform: rotate(45deg);
    -ms-transform: rotate(45deg);
    -webkit-transform: rotate(45deg);
}

<ul class="navsub">
    <li class="nav1"><a href="#">Una volta</a></li>
    <li class="nav1 selected"><a href="#">Un tango</a></li>
    <li class="nav1"> <a href="#">Una ragazza</a></li>
</ul>
&#13;
&#13;
&#13;

如何删除&#34;脏&#34;绘制 Internet Explorer 9 的边框?

3 个答案:

答案 0 :(得分:2)

使用这个方便的工具生成渐变的CSS http://www.colorzilla.com/gradient-editor/

使用IE9支持完整的多站梯度(使用SVG)。

.navsub {
    display: block;
    z-index: 999;
}
.navsub li {
    /*float: left;*/
    margin: 0px 2px;
    padding: 3px 5px;
    display: inline-block;
    border: 2px solid #fff;
    border-radius: 5px;
    z-index: 100;
    position: relative;
}
.navsub li:hover a, .navsub li.selected a {
    color: #fff;
}
.navsub li:hover, .navsub li.selected {    
   background: rgb(204,0,0); /* Old browsers */
/* IE9 SVG, needs conditional override of 'filter' to 'none' */
background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2NjMDAwMCIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjQ3JSIgc3RvcC1jb2xvcj0iI2FhMDAwMCIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiNhYTAwMDAiIHN0b3Atb3BhY2l0eT0iMSIvPgogIDwvbGluZWFyR3JhZGllbnQ+CiAgPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+);
background: -moz-linear-gradient(top, rgb(204,0,0) 0%, rgb(170,0,0) 47%, rgb(170,0,0) 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgb(204,0,0)), color-stop(47%,rgb(170,0,0)), color-stop(100%,rgb(170,0,0))); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, rgb(204,0,0) 0%,rgb(170,0,0) 47%,rgb(170,0,0) 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, rgb(204,0,0) 0%,rgb(170,0,0) 47%,rgb(170,0,0) 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, rgb(204,0,0) 0%,rgb(170,0,0) 47%,rgb(170,0,0) 100%); /* IE10+ */
background: linear-gradient(to bottom, rgb(204,0,0) 0%,rgb(170,0,0) 47%,rgb(170,0,0) 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#cc0000', endColorstr='#aa0000',GradientType=0 ); /* IE6-8 */
    color: white;
}
.navsub li:hover::before, .navsub li.selected::before {
    border: solid;
    border-color: #A00000;
    border-width: 8px 10px 5px 4px;
    bottom: -3px;
    content:"";
    left: 10px;
    position: absolute;
    z-index: -1;
    -webkit-box-shadow: 3px 3px 5px -1px rgba(0, 0, 0, .3);
    box-shadow: 3px 3px 5px -1px rgba(0, 0, 0, .3);
    transform: rotate(45deg);
    -ms-transform: rotate(45deg);
    -webkit-transform: rotate(45deg);
}
<ul class="navsub">
    <li class="nav1"><a href="#">Una volta</a></li>
    <li class="nav1 selected"><a href="#">Un tango</a></li>
    <li class="nav1"> <a href="#">Una ragazza</a></li>
</ul>

答案 1 :(得分:1)

我检查了一下,删除了您border:2px solid #fff;的{​​{1}}。删除它可能会解决您的问题。

答案 2 :(得分:0)

添加

.navsub li{
border-style:none;
}

或删除

border: 2px solid #fff

是否需要白色边框?