Skip to content

Instantly share code, notes, and snippets.

@caputomarcos
Created July 10, 2022 04:33
Show Gist options
  • Save caputomarcos/8ea81e1f69f585f6905374644d42d5d8 to your computer and use it in GitHub Desktop.
Save caputomarcos/8ea81e1f69f585f6905374644d42d5d8 to your computer and use it in GitHub Desktop.
Hexagon Menu [CSS]
<!-- Tuto Video Source : https://youtu.be/ZG1eH2Bu-qI -->
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="style.css">
<title>Document</title>
<link
href="https://fonts.googleapis.com/icon?family=Material+Icons"
rel="stylesheet"
/>
</head>
<body>
<div class="container">
<div class="hexagonArea first">
<div class="hexagon">
<i class="material-icons"> home </i>
<h3>Home</h3>
</div>
<div class="hexagon">
<i class="material-icons"> mail </i>
<h3>Home</h3>
</div>
<div class="hexagon">
<i class="material-icons"> notifications </i>
<h3>Home</h3>
</div>
<div class="hexagon">
<i class="material-icons"> add_a_photo </i>
<h3>Home</h3>
</div>
</div>
<div class="hexagonArea last">
<div class="hexagon">
<i class="material-icons"> videocam </i>
<h3>Home</h3>
</div>
<div class="hexagon">
<i class="material-icons"> language </i>
<h3>Home</h3>
</div>
<div class="hexagon">
<i class="material-icons"> favorite </i>
<h3>Home</h3>
</div>
</div>
</div>
</body>
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;700&display=swap');
*{
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'Poppins', sans-serif;
}
body{
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
background-color: #161623;
}
.container{
width: 950px;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
flex-wrap: wrap;
}
.container .hexagonArea{
display: flex;
}
.container .hexagonArea.last{
transform: translateY(-30px);
}
.container .hexagonArea .hexagon{
cursor: pointer;
position: relative;
width: 150px;
height:180px;
margin: 0 10px;
clip-path: polygon(0 25%, 50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%);
background-color: royalblue;
color: #161623;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
transition: .5s;
}
.container .hexagonArea .hexagon:hover{
background-color: deepskyblue;
transform: scale(.8);
}
.container .hexagonArea .hexagon i{
font-size: 50px;
}
.container .hexagonArea .hexagon h3{
text-transform: uppercase;
font-weight: 600;
margin-top: 10px;
font-size: 17px;
letter-spacing: 1px;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment