-
Notifications
You must be signed in to change notification settings - Fork 6
/
hexagon.html
executable file
·74 lines (69 loc) · 1.85 KB
/
hexagon.html
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
67
68
69
70
71
72
73
74
<html>
<head>
<title>Flexbox Grids</title>
<link rel="stylesheet" href="css/showcase.css">
<link href="https://fonts.googleapis.com/css?family=Ubuntu:300" rel="stylesheet">
<style media="screen">
.hexagon {
position: absolute;
width: 100px;
height: 55px;
text-align: center;
line-height: 55px;
background: rgba(255, 255, 255, 0.3);
position: relative;
}
.hexagon:before {
content: "";
position: absolute;
top: -25px;
left: 0;
width: 0;
height: 0;
border-left: 50px solid transparent;
border-right: 50px solid transparent;
border-bottom: 25px solid rgba(255, 255, 255, 0.3);
}
.hexagon:after {
content: "";
position: absolute;
bottom: -25px;
left: 0;
width: 0;
height: 0;
border-left: 50px solid transparent;
border-right: 50px solid transparent;
border-top: 25px solid rgba(255, 255, 255, 0.3);
}
#hexagon-1 {
top: 50px;
left: 50px;
}
#hexagon-2 {
top: 75px;
left: 100px;
}
#hexagon-3 {
top: 20px;
left: 200px;
}
#hexagon-4 {
top: 45px;
left: 250px;
}
#hexagon-5 {
top: 70px;
left: 200px;
}
</style>
</head>
<body>
<div>
<div id="hexagon-1" class="hexagon">1</div>
<div id="hexagon-2" class="hexagon">2</div>
<div id="hexagon-3" class="hexagon">3</div>
<div id="hexagon-4" class="hexagon">4</div>
<div id="hexagon-5" class="hexagon">5</div>
</div>
</body>
</html>