【发布时间】:2013-04-21 04:08:15
【问题描述】:
我在使用带有overflow:hidden 的position:fixed 元素上使用border-radius 时遇到了Google Chrome 问题。 overflow 属性似乎不起作用。当您将鼠标悬停在导航项上时,带有红色背景 .bmopt 的 div 应该被裁剪为 #mstrip 的形状,但它只是显示为标准矩形。
HTML:
<div id='mstrip'>
<div class='mlabel first'>
<a href='#' class='mopt'>Item1</a>
<div class='bmopt'></div>
</div>
<div class='mlabel'>
<a href='#' class='mopt'>Item2</a>
<div class='bmopt'></div>
</div>
<div class='mlabel'>
<a href='#' class='mopt'>Item3</a>
<div class='bmopt'></div>
</div>
<div class='mlabel'>
<a href='#' class='mopt'>Item4</a>
<div class='bmopt'></div>
</div>
<div class='mlabel'>
<a href='#' class='mopt'>Item5</a>
<div class='bmopt'></div>
</div>
</div>
CSS:
#mstrip {
width: 92px;
height: 223px;
position: fixed;
top: 20px;
border-radius: 40% 8px;
z-index: 100;
background: #000;
overflow: hidden;
box-shadow: 0 0 4px #000;
}
.mlabel {
width: 92px;
height: 35px;
}
.first {
margin-top: 24px;
}
.mopt {
display: block;
width: 92px;
height: 29px;
padding-top: 6px;
text-align: center;
color: #FFF;
text-decoration: none;
font: menu;
font-size: 0.9em;
text-shadow: 0 0 1px #FFF;
}
.bmopt {
position: relative;
width: 92px;
height: 35px;
background: #F00;
margin-top: -35px;
z-index: -1;
}
这里是这个错误的一个工作示例:http://jsfiddle.net/UxLHR/7/
有没有办法解决这个问题?
【问题讨论】:
标签: google-chrome overflow css-position css