CSS 3图形之六边形

清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<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>