Fluid Hexagonal Grid
How do I make an fluid hexagonal grid?
A fluid, responsive hexagonal grid in SCSS.For more techniques for creating fluid hexagons, checkout Flexagons. What is a fluid hexagonal grid? How do you make a fluid hexagonal grid? This script and codes were developed by Joey Hoer on 14 September 2022, Wednesday.
Fluid Hexagonal Grid - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Fluid Hexagonal Grid</title> <script src="https://s.codepen.io/assets/libs/modernizr.js" type="text/javascript"></script> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css"> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div class="container"> <div class="hex"> <div>Hex Grid</div> </div> <div class="hex"> <div>Hex Grid</div> </div> <div class="hex"> <div>Hex Grid</div> </div> <div class="hex"> <div>Hex Grid</div> </div> <div class="hex"> <div>Hex Grid</div> </div> <div class="hex"> <div>Hex Grid</div> </div> <div class="hex"> <div>Hex Grid</div> </div> <div class="hex"> <div>Hex Grid</div> </div> <div class="hex"> <div>Hex Grid</div> </div> <div class="hex"> <div>Hex Grid</div> </div>
</div>
</body>
</html>
Fluid Hexagonal Grid - Script Codes CSS Codes
@import url(//fonts.googleapis.com/css?family=Lilita+One);
.hex { background: #ff0; position: relative; overflow: hidden; visibility: hidden;
}
.hex:before { content: ''; position: absolute; visibility: visible; top: 0; bottom: 0; right: 0; left: 0; -webkit-transform: rotate(-30deg) skewX(30deg) scale(1.155, 0.866); transform: rotate(-30deg) skewX(30deg) scale(1.155, 0.866); background: inherit;
}
.hex:after { content: ''; display: block; padding-top: 115.4734411%;
}
.hex > * { visibility: visible;
}
@media (max-width: 499px) { .hex { float: left; width: 65.66667%; } .hex:nth-child(even) { margin-left: 34.33333%; margin-top: -16.95633%; margin-bottom: -16.95633%; } .hex:nth-child(odd) { margin-right: 34.33333%; } .hex:last-child { margin-bottom: 0; }
}
@media (min-width: 500px) and (max-width: 719px) { .hex { float: left; width: 49%; margin-right: 2%; } .hex:nth-child(3n+1) { margin-left: 25.5%; } .hex:nth-child(3n+1) { margin-right: 25.5%; } .hex:nth-child(3n+3) { margin-right: 0; } .hex:nth-child(3n+2), .hex:nth-child(3n+3) { margin-top: -12.14508%; margin-bottom: -12.14508%; } .hex:last-child { margin-bottom: 0; }
}
@media (min-width: 720px) and (max-width: 879px) { .hex { float: left; width: 32%; margin-right: 2%; } .hex:nth-child(5n+1) { margin-left: 17%; } .hex:nth-child(5n+2) { margin-right: 17%; } .hex:nth-child(5n+5) { margin-right: 0; } .hex:nth-child(5n+3), .hex:nth-child(5n+4), .hex:nth-child(5n+5) { margin-top: -7.2376%; margin-bottom: -7.2376%; } .hex:last-child { margin-bottom: 0; }
}
@media (min-width: 880px) and (max-width: 1099px) { .hex { float: left; width: 23.5%; margin-right: 2%; } .hex:nth-child(7n+1) { margin-left: 12.75%; } .hex:nth-child(7n+3) { margin-right: 12.75%; } .hex:nth-child(7n+7) { margin-right: 0; } .hex:nth-child(7n+4), .hex:nth-child(7n+5), .hex:nth-child(7n+6), .hex:nth-child(7n+7) { margin-top: -4.78387%; margin-bottom: -4.78387%; } .hex:last-child { margin-bottom: 0; }
}
@media (min-width: 1100px) { .hex { float: left; width: 18.4%; margin-right: 2%; } .hex:nth-child(9n+1) { margin-left: 10.2%; } .hex:nth-child(9n+4) { margin-right: 10.2%; } .hex:nth-child(9n+9) { margin-right: 0; } .hex:nth-child(9n+5), .hex:nth-child(9n+6), .hex:nth-child(9n+7), .hex:nth-child(9n+8), .hex:nth-child(9n+9) { margin-top: -3.31162%; margin-bottom: -3.31162%; } .hex:last-child { margin-bottom: 0; }
}
.hex > div { text-align: center; position: absolute; top: 50%; left: 0; right: 0; -webkit-transform: translateY(-50%); transform: translateY(-50%);
}
.container { margin: 0 2%; border: 1px dashed rgba(128, 128, 128, 0.35);
}
@media (min-width: 720px) { .container { width: 50%; margin: auto; }
}
.container:before, .container:after { content: ""; display: table;
}
.container:after { clear: both;
}
body { font: 0.825em/1.2 'Lilita One'; color: #222; text-transform: uppercase; background: #222;
}
*, *:before, *:after { box-sizing: border-box;
}
/* Center */
html, body { height: 100%;
}
html { display: table; width: 100%;
}
body { display: table-cell; vertical-align: middle; text-align: center;
}
Developer | Joey Hoer |
Username | joeyhoer |
Uploaded | September 14, 2022 |
Rating | 3.5 |
Size | 4,453 Kb |
Views | 54,648 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
Mirrored Background | 3,114 Kb |
Flexagons | 5,023 Kb |
Fighting the Space | 2,677 Kb |
Outer Stroke | 5,119 Kb |
Slide to Check | 3,362 Kb |
Shift | 5,797 Kb |
Lightpack | 4,028 Kb |
Multi-line Text Fading | 3,580 Kb |
HR Department | 7,589 Kb |
CSS Middle Child Selector | 3,337 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
Greyscale image with filter in CSS3 | NickyCDK | 1,562 Kb |
Halo 5 REQ Guide Bookmarklet | Cwacht | 3,993 Kb |
Brian The CSS Bee | Jonitrythall | 3,922 Kb |
Adding Items | Valhead | 4,008 Kb |
Multiple jCarousel | Pafnuty | 2,461 Kb |
Iron Man SVG Loading Animation | Andythayer | 3,069 Kb |
Responsive Minimal Blog Layout | Hackthevoid | 5,261 Kb |
JavaScript Animation | Rcmeisty | 4,581 Kb |
Css or Czz.. | Judag | 4,111 Kb |
Svg sky | Omodev | 7,070 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!