用css3实现正6边形
Posted html5开发分享
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了用css3实现正6边形相关的知识,希望对你有一定的参考价值。
1.倾斜正六边形<div id="box"> <div class="con-show01 margin-left margin-top"> <div class="con-show02"> <div class="con-show03 bg04"> <img > </div> </div> </div> </div> <style> #box{ width: 200px;height: 250px; transform: rotate(30deg); } .con-show01{width: 200px;height: 250px;float: left;margin-left: 10px;overflow: hidden;transform:rotate(120deg);} .con-show02{width: 100%;height: 100%;overflow: hidden;transform:rotate(-60deg);} .con-show03{width: 100%;height: 100%;overflow: hidden;transform:rotate(-60deg);position: relative;background: pink;} </style>2.正六边形
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Document</title> </head> <body> <div class="con-show01 margin-left margin-top"> <div class="con-show02"> <div class="con-show03 bg04"> <img > </div> </div> </div> <style> .con-show01{width: 200px;height: 250px;float: left;margin-left: 10px;overflow: hidden;transform:rotate(120deg);} .con-show02{width: 100%;height: 100%;overflow: hidden;transform:rotate(-60deg);} .con-show03{width: 100%;height: 100%;overflow: hidden;transform:rotate(-60deg);position: relative;background: pink;} </style> </body> </html>以上是关于用css3实现正6边形的主要内容,如果未能解决你的问题,请参考以下文章