Responsive grid using flexbox
How do I make an responsive grid using flexbox?
What is a responsive grid using flexbox? How do you make a responsive grid using flexbox? This script and codes were developed by José Manuel Pérez on 12 January 2023, Thursday.
Responsive grid using flexbox - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Responsive grid using flexbox</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div class="container"> <div class=item> <a href="https://placehold.it"><img src="https://placehold.it/300x300"></a> </div> <div class=item> <a href="https://placehold.it"><img src="https://placehold.it/300x300"></a> </div> <div class=item> <a href="https://placehold.it"><img src="https://placehold.it/300x300"></a> </div> <div class=item> <a href="https://placehold.it"><img src="https://placehold.it/300x300"></a> </div> <div class=item> <a href="https://placehold.it"><img src="https://placehold.it/300x300"></a> </div> <div class=item> <a href="https://placehold.it"><img src="https://placehold.it/300x300"></a> </div> <div class=item> <a href="https://placehold.it"><img src="https://placehold.it/300x300"></a> </div>
</div>
</body>
</html>
Responsive grid using flexbox - Script Codes CSS Codes
.container { display: -webkit-box; display: -ms-flexbox; display: flex; -ms-flex-flow: row wrap; flex-flow: row wrap; -webkit-box-pack: start; -ms-flex-pack: start; justify-content: flex-start;
}
@media (min-width: 300px) and (max-width: 800px) { .item { background-color: red; -webkit-box-flex: 0; -ms-flex: 0 0 32%; flex: 0 0 32%; margin: 1% 0; } .item:nth-child(3n-1) { margin-left: 2%; margin-right: 2%; }
}
@media (min-width: 800px) and (max-width: 1000px) { .item { background-color: red; -webkit-box-flex: 0; -ms-flex: 0 0 23.5%; flex: 0 0 23.5%; margin: 1% 0; } .item:nth-child(4n+2) { margin-left: 2%; margin-right: 2%; } .item:nth-child(4n+3) { margin-right: 2%; }
}
@media (min-width: 1000px) and (max-width: 1300px) { .item { background-color: red; -webkit-box-flex: 0; -ms-flex: 0 0 18.4%; flex: 0 0 18.4%; margin: 1% 0; } .item:nth-child(5n+2), .item:nth-child(5n+4) { margin-left: 2%; margin-right: 2%; }
}
@media (min-width: 1300px) { .item { background-color: red; -webkit-box-flex: 0; -ms-flex: 0 0 15%; flex: 0 0 15%; margin: 1% 0; } .item:nth-child(6n+2), .item:nth-child(6n+4) { margin-left: 2%; margin-right: 2%; } .item:nth-child(6n+5) { margin-right: 2%; }
}
.item img { display: block; width: 100%;
}
Developer | José Manuel Pérez |
Username | jmperez |
Uploaded | January 12, 2023 |
Rating | 3 |
Size | 2,128 Kb |
Views | 4,048 |
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 |
Reproducing Medium loading image effect | 2,240 Kb |
Reproducing Medium loading image effect - WebP version | 2,402 Kb |
Flexbox for image layout | 1,498 Kb |
Voice commands - Play a song | 3,320 Kb |
Alerting window popup | 1,358 Kb |
Spotify - Now Playing Visualization | 2,783 Kb |
Playing with a map | 2,245 Kb |
Drawing SVGs - Spotify Logo | 3,059 Kb |
Spotify SVG | 2,319 Kb |
Responsive grid using grid | 1,890 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 |
Right Click Menu | Anodpixels | 2,252 Kb |
C.Rowe Button | Brownerd | 2,473 Kb |
Scroll effect with text with help from Skrollr | Luxonglassing | 2,935 Kb |
Simple search using AngularJS | Haykou | 1,802 Kb |
Mega Menu by Joni | Asakasinsky | 3,171 Kb |
Table border-collapse property | Maxds | 1,672 Kb |
The Monty Hall Problem | Melatonind | 4,360 Kb |
Minimal Material Design Form Input | Koenigsegg1 | 3,076 Kb |
Incremental game | Eprouver | 5,868 Kb |
Map Controls | Iliadraznin | 3,721 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!