IE 9、8、7 中的边框半径问题
我已附上我在网站上使用的菜单的图片,除了 IE 之外,所有其他浏览器都会呈现正确的输出:
即使在 IE9 中,悬停效果也应该是弯曲的,但它却出现了矩形效果。
Firefox、safari 和 chrome 工作正常:
Css
header nav {
padding:7px 0 10px 0;
}
header nav ul {
float:right;
padding:2px 0 0 0;
}
header nav ul li {
float:left;
padding-left:4px;
}
header nav ul li a {
position:relative;
float:left;
font-size:14px;
color:#fff;
text-decoration:none;
font-family: 'ColaborateThinRegular';
text-transform:uppercase;
height:32px;
line-height:32px;
background-color:#181717;
padding:0 36px 0 10px;
border-radius:17px;
-moz-border-radius:17px;
-webkit-border-radius:17px;
}
header nav ul li a:hover,
header nav ul li a.current {
background-image: -moz-linear-gradient(top, #E53088, #E530C1); /* FF3.6 */
background-image: -webkit-gradient(linear,left bottom,left top,color-stop(0, #E53088),color-stop(1, #E530C1)); /* Saf4+, Chrome */
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#E53088', endColorstr='#E530C1'); /* IE6,IE7 */
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr='#E53088', endColorstr='#E530C1')"; /* IE8 */
border-radius:17px;
-moz-border-radius:17px;
-webkit-border-radius:17px;
}
我正在寻找与 firefox、chrome 和 safari 相同的行为
I have attached the image below of the menu which i am using for my site , Apart from IE , all the other browsers renders the correct output :
Even in IE9 the hover effect should be curvy but it comes up with rectangular effect .
Firefox , safari , and chrome works fine :
Css
header nav {
padding:7px 0 10px 0;
}
header nav ul {
float:right;
padding:2px 0 0 0;
}
header nav ul li {
float:left;
padding-left:4px;
}
header nav ul li a {
position:relative;
float:left;
font-size:14px;
color:#fff;
text-decoration:none;
font-family: 'ColaborateThinRegular';
text-transform:uppercase;
height:32px;
line-height:32px;
background-color:#181717;
padding:0 36px 0 10px;
border-radius:17px;
-moz-border-radius:17px;
-webkit-border-radius:17px;
}
header nav ul li a:hover,
header nav ul li a.current {
background-image: -moz-linear-gradient(top, #E53088, #E530C1); /* FF3.6 */
background-image: -webkit-gradient(linear,left bottom,left top,color-stop(0, #E53088),color-stop(1, #E530C1)); /* Saf4+, Chrome */
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#E53088', endColorstr='#E530C1'); /* IE6,IE7 */
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr='#E53088', endColorstr='#E530C1')"; /* IE8 */
border-radius:17px;
-moz-border-radius:17px;
-webkit-border-radius:17px;
}
I am looking for the same behaviour like firefox, chrome and safari
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
Internet Explorer 中的渐变过滤器不会被 Internet Explorer 9 中的
border-radius
剪切。我能想到的唯一解决方案是使用内部应用了渐变的元素:
将
border-radius
应用于元素,并将渐变应用于
正如 Salman A 提到的,唯一的其他选择是 CSS3 PIE,它可以为您解决这个问题并且在旧版本的IE中实现
border-radius
。我在几个项目中使用它并且效果很好。The gradient filter in Internet Explorer doesn't get clipped by the
border-radius
in Internet Explorer 9. The only solution I can think of involves having an inner<div>
element with the gradient applied:Apply the
border-radius
to the<li>
element and the gradient to<div class="gradient">
. This should give the correct result.The only other option, as Salman A mentioned, is CSS3 PIE, which work around this problem for you and implement
border-radius
in older versions of IE. I'm using this in a couple of projects and it works very well.查看 CSS3 PIE 项目。它将在 IE 6 到 9 中提供各种 CSS3 功能;包括圆角。
Have a look at the CSS3 PIE project. It will make various CSS3 features available in IE 6 through 9; including rounded corners.
尝试
举一个简单的例子
try
just a quick example
Twitter Bootstrap 执行以下操作来解决此问题:
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
Twitter Bootstrap does the following to solve this issue:
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);