【发布时间】:2010-12-17 05:16:07
【问题描述】:
我正在使用以下方法来实现圆角:
-moz-border-radius: 10px;
border-radius: 10px;
-webkit-border-radius: 10px;
这适用于除 Chrome 之外的所有浏览器(但不包括 IE)。这是它在 Chrome 中的外观:
但同一页面在 Safari 中可以正常显示。作为 Webkit 浏览器,为什么这两种浏览器显示之间存在差异?这是它在 Safari 中的外观:
为什么会这样?
这是我正在使用的标记:
html:
div#one1 {
position: relative;
border-bottom: solid 2px #2D2DFF;
width: 800px;
height: 100px;
color: #FFF;
-moz-border-radius-topleft: 10px;
-moz-border-radius-topleft: 10px;
border-radius-topleft: 10px;
border-radius-topleft: 10px;
-webkit-border-top-left-radius: 20px;
-webkit-border-top-right-radius: 20px;
box-shadow: inset 0 0.5px rgba(255, 255, 255, 0.3), inset 0 1px rgba(255, 255, 255, 0.2), inset 0 1px 20px rgba(255, 255, 255, 0.25), inset 0 -15px 150px rgba(0, 0, 0, 0.3);
-o-box-shadow: inset 0 0.5px rgba(255, 255, 255, 0.3), inset 0 1px rgba(255, 255, 255, 0.2), inset 0 1px 20px rgba(255, 255, 255, 0.25), inset 0 -15px 150px rgba(0, 0, 0, 0.3);
-webkit-box-shadow: inset 0 0.5px rgba(255, 255, 255, 0.3), inset 0 1px rgba(255, 255, 255, 0.2), inset 0 1px 20px rgba(255, 255, 255, 0.25), inset 0 -15px 150px rgba(0, 0, 0, 0.3);
-moz-box-shadow: inset 0 0.5px rgba(255, 255, 255, 0.3), inset 0 1px rgba(255, 255, 255, 0.2), inset 0 1px 20px rgba(255, 255, 255, 0.25), inset 0 -15px 150px rgba(0, 0, 0, 0.3);
}
<div id="one1">
this is one event that is going to happen.....
<br />and then the other.......
<br />
</div>
【问题讨论】:
-
如果你想让
border-radius和box-shadow也能在IE 中工作,请查看css3pie.com
标签: google-chrome css rounded-corners