Simple Grid - pure CSS
How do I make an simple grid - pure css?
What is a simple grid - pure css? How do you make a simple grid - pure css? This script and codes were developed by FerdousAlQuraeshi on 14 September 2022, Wednesday.
Simple Grid - pure CSS - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Simple Grid - pure CSS</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div class="container grid-pad"> <div class="col-lg-2 col-md-4 col-sm-6 col-xs-12">grid#1 </div> <div class="col-lg-2 col-md-4 col-sm-6 col-xs-12">grid#2</div> <div class="col-lg-4 col-md-4 col-sm-6 col-xs-12">grid#3</div> <div class="col-lg-4 col-md-4 col-sm-6 col-xs-12">grid#4</div>
</div>
</body>
</html>
Simple Grid - pure CSS - Script Codes CSS Codes
*, *:after, *:before { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box;
}
:root{ --laal: red; --bg-color-odd: #bfbfbf; --bg-color-even: #d9d9d9;
}
.container{ width: 100%; margin: 0 auto;
/* outline: 5px dashed green; */
}
.container:after { content: ""; display: table; clear: both;
}
[class*="col-"] { float: left; padding: 15px; outline: 1px dashed red; background-color: var(--bg-color-odd); text-align: center; }
[class*="col-"]:nth-child(even){ background-color: var(--bg-color-even);
}
/* =========================================== Declaring Common Grids Patterns on Fallback
==============================================*/
.col-1 { width: calc(1/12*100%);
}
.col-2 { width: calc(2/12*100%);
}
.col-3 { width: calc(3/12*100%);
}
.col-4 { width: calc(4/12*100%);
}
.col-5 { width: calc(5/12*100%);
}
.col-6 { width: calc(6/12*100%);
}
.col-7 { width: calc(7/12*100%);
}
.col-8 { width: calc(8/12*100%);
}
.col-9 { width: calc(9/12*100%);
}
.col-10 { width: calc(10/12*100%);
}
.col-11 { width: calc(11/12*100%);
}
.col-12 { width: calc(12/12*100%);
}
/* =============================================== for Breakpoint management with @madiaQueries
==================================================*/
@media (min-width: 1200px) { .col-lg-1 { width: calc(1/12*100%); } .col-lg-2 { width: calc(2/12*100%); } .col-lg-3 { width: calc(3/12*100%); } .col-lg-4 { width: calc(4/12*100%); } .col-lg-5 { width: calc(5/12*100%); } .col-lg-6 { width: calc(6/12*100%); } .col-lg-7 { width: calc(7/12*100%); } .col-lg-8 { width: calc(8/12*100%); } .col-lg-9 { width: calc(9/12*100%); } .col-lg-10 { width: calc(10/12*100%); } .col-lg-11 { width: calc(11/12*100%); } .col-lg-12 { width: calc(12/12*100%); }
}
@media (min-width: 992px) and (max-width:1199px) { .col-md-1 { width: calc(1/12*100%); } .col-md-2 { width: calc(2/12*100%); } .col-md-3 { width: calc(3/12*100%); } .col-md-4 { width: calc(4/12*100%); color: var(--laal); } .col-md-5 { width: calc(5/12*100%); } .col-md-6 { width: calc(6/12*100%); } .col-md-7 { width: calc(7/12*100%); } .col-md-8 { width: calc(8/12*100%); } .col-md-9 { width: calc(9/12*100%); } .col-md-10 { width: calc(10/12*100%); } .col-md-11 { width: calc(11/12*100%); } .col-md-12 { width: calc(12/12*100%); }
}
@media (min-width: 768px) and (max-width: 991px) { .col-sm-1 { width: calc(1/12*100%); } .col-sm-2 { width: calc(2/12*100%); } .col-sm-3 { width: calc(3/12*100%); } .col-sm-4 { width: calc(4/12*100%); } .col-sm-5 { width: calc(5/12*100%); } .col-sm-6 { width: calc(6/12*100%); } .col-sm-7 { width: calc(7/12*100%); } .col-sm-8 { width: calc(8/12*100%); } .col-sm-9 { width: calc(9/12*100%); } .col-sm-10 { width: calc(10/12*100%); } .col-sm-11 { width: calc(11/12*100%); } .col-sm-12 { width: calc(12/12*100%); }
}
@media (min-width: 480px) and (max-width: 767px) { .col-xs-1 { width: calc(1/12*100%); } .col-xs-2 { width: calc(2/12*100%); } .col-xs-3 { width: calc(3/12*100%); } .col-xs-4 { width: calc(4/12*100%); } .col-xs-5 { width: calc(5/12*100%); } .col-xs-6 { width: calc(6/12*100%); } .col-xs-7 { width: calc(7/12*100%); } .col-xs-8 { width: calc(8/12*100%); } .col-xs-9 { width: calc(9/12*100%); } .col-xs-10 { width: calc(10/12*100%); } .col-xs-11 { width: calc(11/12*100%); } .col-xs-12 { width: calc(12/12*100%); }
}
@media (max-width: 479px){ [class*="col-"] { width: calc(12/12*100%); }
}
![Simple Grid - pure CSS - Script Codes](http://shots.codepen.io/ferdous-al-quraeshi/pen/NbJMem-512.jpg)
Developer | FerdousAlQuraeshi |
Username | ferdous-al-quraeshi |
Uploaded | September 14, 2022 |
Rating | 3 |
Size | 2,159 Kb |
Views | 36,432 |
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 |
A Custom-made Tooltip | 1,732 Kb |
Simple Grid - pure CSS | 2,159 Kb |
A Pet layout project in SASS | 3,241 Kb |
Printing Right Triangle Mirror Pattern | 1,520 Kb |
JQuery - retrieve all the elements in an array | 1,782 Kb |
Centered Heading Overlaying a Horizontal Line with CSS | 2,031 Kb |
Practicing jQuery | 2,223 Kb |
Animation to Explain CSS Triangles | 1,513 Kb |
Responsive Grid System with SASS | 3,125 Kb |
Blurred on edges horizontal line | 1,456 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 |
Bootstrap 3 Price Table | Honglio | 2,655 Kb |
After America | Jonathangarner | 2,686 Kb |
Product item | Mymahesh11 | 2,256 Kb |
TinFoil Boats | Chandralil | 4,577 Kb |
Angular-HAML | Cwacht | 2,022 Kb |
RequestAnimationFrame | Martin-banks | 2,541 Kb |
Simple Buttons | Haydenmills | 1,750 Kb |
Progressively reveal dots on a Bezier curve | GreenSock | 2,489 Kb |
Animate elements with fixed gradient | Badabam | 4,406 Kb |
CLE_Old_March | Saritaleroux | 6,234 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!