The 4 grid techniques

Developer
Size
6,969 Kb
Views
24,288

How do I make an the 4 grid techniques?

Can I demystify girds? They aren't hard to make. And there are really only four ways to pull them off: Floats, Inline-Blocks, Table-Cells and Flexbox.. What is a the 4 grid techniques? How do you make a the 4 grid techniques? This script and codes were developed by BROWNERD on 29 August 2022, Monday.

The 4 grid techniques Previews

The 4 grid techniques - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>The 4 grid techniques</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css"> <link rel='stylesheet prefetch' href='css/780b5c5a7f1f5b27af926c88e.css'> <link rel="stylesheet" href="css/style.css">
</head>
<body> h1 The 4 Grid Techniques
.perimeter__float h2 Floating Grid (Classic) p.description This grid uses "floats" to create it's columns. Since floats don't have layout, you need something to force them to encapsulate thier contents. This is commonly fixed by using a "ClearFix" (which ironicaly uses "display: table-cell"). However, I just used "overflow: hidden." This is a classic grid solution. Columns always align to the top of their container, and the column is only as tall as it's content. .container .col-6-12 .content p Bushwick fanny pack high life wolf single-origin coffee american apparel, cred twee gluten-free mixtape mlkshk ethical carles Austin direct trade. Etsy banksy biodiesel ethnic, cardigan chambray lomo four loko single-origin coffee. Wes anderson dreamcatcher chillwave whatever, before they sold out master cleanse polaroid fixie skateboard yr. .col-6-12 .content p Mcsweeney's PBR typewriter banksy wes anderson helvetica. Synth sriracha salvia, selvage pour-over 3 wolf moon 8-bit cosby sweater street art swag. Artisan echo park shoreditch, semiotics iphone dreamcatcher farm-to-table pinterest flexitarian cred ennui irony bicycle rights. Narwhal whatever etsy retro, kogi yr salvia fixie pork belly master cleanse wolf ethical PBR VHS. .container .col-4-12 .content p Bushwick fanny pack high life wolf single-origin coffee american apparel, cred twee gluten-free mixtape mlkshk ethical carles Austin direct trade. .col-4-12 .content p Bushwick fanny pack high life wolf single-origin coffee american apparel. .col-4-12 .content p Bushwick fanny pack high life wolf single-origin coffee american apparel, cred twee gluten-free mixtape mlkshk ethical carles Austin direct trade.
.perimeter__inline-block h2 Inline-block Grid p.description | This grid uses "inline-blocks" to create it's columns. The columns are set to "display: inline-block" and their parent can use "text-align" to position the inline elements. This technique was mostly used for achieving horizontal navigation without using floats. This works great however, 4px of margin gets added to each inline-block. You need to <a href="https://css-tricks.com/fighting-the-space-between-inline-block-elements/"> correct</a> this by using "margin-right: -4px." Columns align to the bottom of their container, however you can use vertical alignment to position them. It's columns are only as tall as it's content also. .col-6-12 .content p Bushwick fanny pack high life wolf single-origin coffee american apparel, cred twee gluten-free mixtape mlkshk ethical carles Austin direct trade. Etsy banksy biodiesel ethnic, cardigan chambray lomo four loko single-origin coffee. Wes anderson dreamcatcher chillwave whatever, before they sold out master cleanse polaroid fixie skateboard yr. .col-6-12 .content p Mcsweeney's PBR typewriter banksy wes anderson helvetica. Synth sriracha salvia, selvage pour-over 3 wolf moon 8-bit cosby sweater street art swag. Artisan echo park shoreditch, semiotics iphone dreamcatcher farm-to-table pinterest flexitarian cred ennui irony bicycle rights. Narwhal whatever etsy retro, kogi yr salvia fixie pork belly master cleanse wolf ethical PBR VHS. .container .col-4-12 .content p Bushwick fanny pack high life wolf single-origin coffee american apparel, cred twee gluten-free mixtape mlkshk ethical carles Austin direct trade. .col-4-12 .content p Bushwick fanny pack high life wolf single-origin coffee american apparel. .col-4-12 .content p Bushwick fanny pack high life wolf single-origin coffee american apparel, cred twee gluten-free mixtape mlkshk ethical carles Austin direct trade.
.perimeter__table-cell h2 Table-cell Grid p.description This grid uses "table-cell" to create it's columns. The columns are set to "display: table-cell" and their parent is set to "table." Table-cells fill their rows completely, so you don't get potholes in your rows like you do with Floats and Inline-Blocks. This technique works like a charm, but everyone freaks out about using table behavior in CSS. This behavior is so good, that the "clearfix" to correct floating grids is based off of it! The content of a table-cell can be vertically positioned as well by using "vertical-align: [top, middle, bottom]." .container .col-6-12 .content p Bushwick fanny pack high life wolf single-origin coffee american apparel, cred twee gluten-free mixtape mlkshk ethical carles Austin direct trade. Etsy banksy biodiesel ethnic, cardigan chambray lomo four loko single-origin coffee. Wes anderson dreamcatcher chillwave whatever, before they sold out master cleanse polaroid fixie skateboard yr. .col-6-12 .content p Mcsweeney's PBR typewriter banksy wes anderson helvetica. Synth sriracha salvia, selvage pour-over 3 wolf moon 8-bit cosby sweater street art swag. Artisan echo park shoreditch, semiotics iphone dreamcatcher farm-to-table pinterest flexitarian cred ennui irony bicycle rights. Narwhal whatever etsy retro, kogi yr salvia fixie pork belly master cleanse wolf ethical PBR VHS. .container .col-4-12 .content p Bushwick fanny pack high life wolf single-origin coffee american apparel, cred twee gluten-free mixtape mlkshk ethical carles Austin direct trade. .col-4-12 .content p Bushwick fanny pack high life wolf single-origin coffee american apparel. .col-4-12 .content p Bushwick fanny pack high life wolf single-origin coffee american apparel, cred twee gluten-free mixtape mlkshk ethical carles Austin direct trade.
.perimeter__flex h2 FlexBox Grid p.description This grid uses "Flexbox" to create it's columns. The parent element holding the columns is set to "display: flex," and that tells all of it's immediate children to line the fuck UP! Done, columns made. This is the new way to create columns. Flexbox gives you all kinds of settings to control the position, order, alignment, size and behavior of it's contents. Flexbox fucking rocks and should be used all the time. I use Table-Cell as a fall back in browsers that don't support flexbox. I do this because table-cell has the closest behavior to Flexbox and it gives me vertical and horizontal centering. .container .col-6-12 .content p Bushwick fanny pack high life wolf single-origin coffee american apparel, cred twee gluten-free mixtape mlkshk ethical carles Austin direct trade. Etsy banksy biodiesel ethnic, cardigan chambray lomo four loko single-origin coffee. Wes anderson dreamcatcher chillwave whatever, before they sold out master cleanse polaroid fixie skateboard yr. .col-6-12 .content p Mcsweeney's PBR typewriter banksy wes anderson helvetica. Synth sriracha salvia, selvage pour-over 3 wolf moon 8-bit cosby sweater street art swag. Artisan echo park shoreditch, semiotics iphone dreamcatcher farm-to-table pinterest flexitarian cred ennui irony bicycle rights. Narwhal whatever etsy retro, kogi yr salvia fixie pork belly master cleanse wolf ethical PBR VHS. .container .col-4-12 .content p Bushwick fanny pack high life wolf single-origin coffee american apparel, cred twee gluten-free mixtape mlkshk ethical carles Austin direct trade. .col-4-12 .content p Bushwick fanny pack high life wolf single-origin coffee american apparel. .col-4-12 .content p Bushwick fanny pack high life wolf single-origin coffee american apparel, cred twee gluten-free mixtape mlkshk ethical carles Austin direct trade.
.perimeter__colophone h2 Outtro p.description All grids are responsive, yet none use any breakpoints. I wanted to show the vanilla behavior of each technique when resized. <script src="js/index.js"></script>
</body>
</html>

The 4 grid techniques - Script Codes CSS Codes

* { box-sizing: border-box;
}
:root { font-size: 18px;
}
body { background-color: #eee; color: #333; font-family: source sans pro; font-weight: 200; line-height: 1.25; margin-top: 2rem;
}
h1 { font-size: 8vw; font-weight: 900; padding: 1rem; text-align: center; text-shadow: 5px 5px 0 #ccc; text-transform: uppercase;
}
h2 { font-size: 5vw; font-weight: 600; position: relative; text-align: center; text-shadow: 5px 5px 0 #eee; text-transform: uppercase;
}
h2::after { border-bottom: 5px solid #333; bottom: -1rem; content: ''; left: 50%; position: absolute; transform: translateX(-50%); width: 6rem;
}
a { background-color: #0fc; color: #333; text-decoration: none;
}
a:hover { background-color: #333; color: #0fc;
}
.description { font-family: source serif pro; line-height: 1.5; padding: 2rem 6rem;
}
[class^=perimeter] { background-color: #fff; box-shadow: 10px 10px 0 #ddd; margin: 4rem auto; padding: 2rem; width: 80vmax;
}
.content { background-color: #333; color: #ddd; margin: 1rem; padding: 1rem;
}
[class^=col] { background: repeating-linear-gradient(-45deg, transparent, transparent 25%, #0fc 0, #0fc 50%), #333; background-size: 2rem 2rem;
}
[class*='6-12'] { width: 50%;
}
[class*='4-12'] { width: 33.33333333333333%;
}
.perimeter__float { margin-top: 2rem;
}
.perimeter__float .container { overflow: hidden;
}
.perimeter__float .col-6-12,
.perimeter__float .col-4-12 { float: left;
}
.perimeter__inline-block .container { text-align: center;
}
.perimeter__inline-block .col-6-12,
.perimeter__inline-block .col-4-12 { display: inline-block; margin-right: -3px;
}
.perimeter__table-cell .container { display: table;
}
.perimeter__table-cell .col-6-12,
.perimeter__table-cell .col-4-12 { display: table-cell;
}
.perimeter__flex .container { display: flex;
}

The 4 grid techniques - Script Codes JS Codes

(function() {
}).call(this);
The 4 grid techniques - Script Codes
The 4 grid techniques - Script Codes
Home Page Home
Developer BROWNERD
Username brownerd
Uploaded August 29, 2022
Rating 4.5
Size 6,969 Kb
Views 24,288
Do you need developer help for The 4 grid techniques?

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!

BROWNERD (brownerd) Script Codes
Create amazing blog posts with AI!

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!