[英]Rounded side, not rounded corners
我想创建一个完全在 CSS 中显示的形状。 如您所知,与简单地应用圆角相比,需要更多的调整......
可以做到吗?
这是 jsfiddle: http : //jsfiddle.net/swqZL/
带有类“figure”的元素 div 的 CSS:
.figure {
height: 400px;
width: 200px;
background-color: black;
border-bottom-left-radius: 100%30px;
border-bottom-right-radius: 100%30px;
}
水平半径 100%,垂直半径 30px
<div style="background: black;
width: 300px;
height: 450px;
padding-top: 50px;">
<div style="width: 200px;
height: 400px;
background: white;
margin: 0 auto;
border-radius: 0 0 100px 100px / 0 0 25px 25px;
-moz-border-radius: 0 0 100px 100px / 0 0 25px 25px;
-webkit-border-radius: 0 0 100px 100px / 0 0 25px 25px;
">
</div>
</div>
在此处找到有关选择性椭圆形边框半径的信息: http : //www.sitepoint.com/setting-css3-border-radius-with-slash-syntax/
工作片段:
.border-radius-example { width: 125px; height: 175px; background: #000; margin: 20px; float: left; padding: 5px; } #border-radius-bottom { -moz-border-radius-bottomleft: 100%35px; -webkit-border-bottom-left-radius: 100%35px; border-bottom-left-radius: 100%35px; -moz-border-radius-bottomright: 100%35px; -webkit-border-bottom-right-radius: 100%35px; border-bottom-right-radius: 100%35px; }
<div class='border-radius-example' id='border-radius-bottom'> </div>
添加到以前的回答:
这可能会增加一些动态价值
/****/
border-top-right-radius: 25%40%;
border-top-left-radius: 25%40%;
border-bottom-left-radius:25%40%;
border-bottom-right-radius: 25%40%;
/****/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.