这种布局
自己试了下border-top-left/right-radius:50%,
但是差别很大,有没有什么好的纯html+css方案推荐?
border-top-left-radius: 300px 50px;
border-top-right-radius: 300px 50px;
//設置兩個值可以達到橢圓圓角的效果
position:relative;
toop:10rem;
height:4rem;
就能基本形似了;
更新答案:希望PO主不是伸手党;
<html>
<style>
.bg{
background:blue;
width:320px;
height:100%;
min-height:100%;
max-height:100%;
overflow:hidden;
box-sizing: border-box;
padding-top:5rem;
position: relative;
overflow:hidden;
}
.bg .content{
display: block;
padding:4rem 1rem 0;
position: relative;
z-index:2;
}
.bg .decoration{
height:640px;
width:640px;
position: absolute;
left:-160px;
background:white;
border-radius:50%;
z-index:1;
box-sizing: border-box;
}
.bg .decoration:before{
display: block;
content:"";
margin:5px;
height:626px;
width:626px;
border-radius:50%;
border:2px dashed blue;
}
</style>
<body>
<div class="bg">
<div class="decoration">
</div>
<div class="content">
这里是内容
</div>
</div>
</body>
</html>
border-radius是可以设置水平半径和垂直半径的,格式为 水平/垂直 比如
border-radius:20px/10px;
样子大概是这样
手机答的图片为手绘:->
5 回答1.4k 阅读
5 回答1.5k 阅读✓ 已解决
2 回答905 阅读✓ 已解决
3 回答779 阅读✓ 已解决
4 回答1.2k 阅读✓ 已解决
2 回答1.3k 阅读✓ 已解决
2 回答873 阅读✓ 已解决
http://codepen.io/exdestroyer/pen/JXOVzL