DDR爱好者之家 Design By 杰米
纯CSS绘制的六边形

纯css绘制蜂巢六边形效果


复制代码代码如下:
<html>
<head>
<title>Draw Hive</title>
</head>
<style type="text/css">
.hexagon {
display: inline;
float: left;
}
#second {
margin-left: 4px;
}
#third {
clear: left;
margin-left: 54px;
margin-top: -28px;
}
.hiveTop{
width: 0;
border: 30px solid #6C6;
border-top: none;
border-bottom: 30px solid #6C6;
border-left: 52px solid transparent;
border-right: 52px solid transparent;
}
.hiveCenter {
width: 104px;
height: 60px;
background-color: #6C6;
}
.hiveBottom {
width: 0;
border: 30px solid #6C6;
border-bottom: none;
border-top: 30px solid #6C6;
border-left: 52px solid transparent;
border-right: 52px solid transparent;
}
</style>
<body>
<div class="hexagon" id="first">
<div class="hiveTop">
</div>
<div class="hiveCenter">
</div>
<div class="hiveBottom">
</div>
</div>
<div class="hexagon" id="second">
<div class="hiveTop">
</div>
<div class="hiveCenter">
</div>
<div class="hiveBottom">
</div>
</div>
<div class="hexagon" id="third">
<div class="hiveTop">
</div>
<div class="hiveCenter">
</div>
<div class="hiveBottom">
</div>
</div>
</body>
</html>
DDR爱好者之家 Design By 杰米
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
DDR爱好者之家 Design By 杰米