1/* Link to Codepen in source for PoC */
2
3<style>
4.container {
5 background: dodgerblue;
6 padding: 20px;
7 height: 70px;
8}
9
10#hamburger {
11 width: 40px;
12 height: 40px;
13 display: block;
14 position: relative;
15 float: right;
16 transform: rotate(0deg);
17 transition: .5s ease-in-out;
18 cursor: pointer;
19}
20#hamburger span {
21 display: block;
22 position: absolute;
23 height: 4px;
24 width: 100%;
25 background: white;
26 border-radius: 9px;
27 opacity: 1;
28 left: 0;
29 transform: rotate(0deg);
30 transition: .25s ease-in-out;
31}
32#hamburger span:nth-child(1) {
33 top: 0px;
34}
35#hamburger span:nth-child(2) {
36 top: 12px;
37}
38#hamburger span:nth-child(3) {
39 top: 24px;
40}
41#hamburger.open span:nth-child(1) {
42 top: 14px;
43 transform: rotate(135deg);
44}
45#hamburger.open span:nth-child(2) {
46 opacity: 0;
47 left: -60px;
48}
49#hamburger.open span:nth-child(3) {
50 top: 14px;
51 transform: rotate(-135deg);
52}
53
54</style>
55<body>
56 <div class="container">
57 <div id="hamburger">
58 <span></span>
59 <span></span>
60 <span></span>
61 </div>
62 </div>
63</body>
64