大佬教程收集整理的这篇文章主要介绍了html – 如何使用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;}
输出是六边形的4个边缘弯曲,但顶部和底部不是.我想让六边形的所有边缘弯曲.如何使顶部和底部边缘弯曲?或如何使三角形的顶边弯曲?
CSS
.hex { position: relative; margin: 1em auto; width: 10em; height: 17.32em; border-radius: 1em/.5em; BACkground: orange; transition: opacity .5s; } .hex:before,.hex:after { position: absolute; width: inherit; height: inherit; border-radius: inherit; BACkground: inherit; content: ''; } .hex:before { -webkit-transform: rotate(60deg); -ms-transform: rotate(60deg);/*Added for IE9*/ transform: rotate(60deg); } .hex:after { -webkit-transform: rotate(-60deg); -ms-transform: rotate(-60deg);/*Added for IE9*/ transform: rotate(-60deg); }
请在问题之前再搜索一下.没有恶意 :)
以上是大佬教程为你收集整理的html – 如何使用CSS制作弯曲的边缘六边形全部内容,希望文章能够帮你解决html – 如何使用CSS制作弯曲的边缘六边形所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。