如何通过简单的DIV与css实现这一目标?
HTML:
<div class="curv">
<div class="holder"></div>
</div>
CSS:
.curv{
width: 800px;
margin: 0 auto;
position: relative;
padding-top: 100px;
overflow: hidden;
}
.curv:before{
background: #333;
width: 100%;
height: 200px;
left: 0px;
right: 0px;
top: 0px;
content: '';
position: absolute;
border-radius: 100% 100% 0 0;
}
.holder{
width: 100%;
height: 200px;
background: #333;
position: relative;
z-index: 9999;
}
答案 0 :(得分:1)
请检查更新的代码
.curv{
width: 800px;
margin: 0 auto;
position: relative;
padding-top: 100px;
overflow: hidden;
}
.curv:before{
background: #333;
height: 200px;
left: -20px;
right: -20px;
top: 10px;
content: '';
position: absolute;
border-radius: 100% 100% 0 0;
}
.holder{
height: 200px;
background: #333;
position: relative;
z-index: 9999;
}
&#13;
<div class="curv">
<div class="holder"></div>
</div>
&#13;