小编soo*_*005的帖子

如何使用CSS制作弯曲的六边形

这是我的CSS.

CSS

#hexagon-circle { 
    width: 100px; 
    height: 55px; 
    background: red; 
    position: relative;
    border-radius: 10px;} 
#hexagon-circle:before { 
    content: ""; 
    position: absolute; 
    top: -25px; 
    left: 0; 
    width: 0; 
    height: 0; 
    border-left: 50px solid transparent; 
    border-right: 50px solid transparent; 
    border-bottom: 29px solid red;
    border-radius: 10px;} 
#hexagon-circle:after { 
    content: ""; 
    position: absolute; 
    bottom: -25px; 
    left: 0; 
    width: 0; 
    height: 0; 
    border-left: 50px solid transparent; 
    border-right: 50px solid transparent; 
    border-top: 29px solid red;
    border-radius: 10px;}
Run Code Online (Sandbox Code Playgroud)

输出是四边形的六边形是弯曲的,但顶部和底部不是.我想让六边形的所有边缘弯曲.如何使顶部和底部边缘弯曲?或如何使三角形的顶边弯曲?

http://jsfiddle.net/yR7zt/ 1

html css css3 css-shapes

9
推荐指数
3
解决办法
1万
查看次数

标签 统计

css ×1

css-shapes ×1

css3 ×1

html ×1