Search

Nalezeno "grid": 149

How to Use CSS Grid for Sticky Headers and Footers


CSS Grid is a collection of properties designed to make layout easier than it’s ever been. Like anything, there’s a bit of a learning curve, but Grid is honestly fun to work with once you get the hang of it. One area where it shines is dealing with headers and footers. With a little...

A Lightweight Masonry Solution


Back in May, I learned about Firefox adding masonry to CSS grid. Masonry layouts are something I’ve been wanting to do on my own from scratch for a very long time, but have never known where to start. So, naturally, I checked the demo and then I had a lightbulb moment when I understood...

Accordion Rows in CSS Grid


I’d bet grid-template-columns is used about 10× more than grid-template-rows, but maybe everyone has just been missing out. Eric Meyer chucks a bunch of row lines onto his main site layout grid like this: grid-template-rows: repeat(7, min-content) 1fr repeat(3, min-content); That way, if...

Grid for layout, flexbox for components


When should we reach for CSS grid and when should we use flexbox? Rachel Andrew wrote about this very conundrum way back in 2016: Flexbox is essentially for laying out items in a single dimension – in a row OR a column. Grid is for layout of items in two dimensions – rows AND columns. Ahmad...

A Glitchy Grid Layout Slideshow


An experimental grid slideshow with a stack-like navigation and glitch effect. The post A Glitchy Grid Layout Slideshow appeared first on Codrops

Building a hexagonal grid using CSS grid


I think of grids as arrangements of rectangles with vertical and horizontal lines running through. And they are, but that doesn’t mean we can’t still do clever things in how we place things on those grids and what we do with the elements afterwards. In this demo by Jesse Breneman,...

Cool Little CSS Grid Tricks for Your Blog


I discovered CSS about a decade ago while trying to modify the look of a blog I had created. Pretty soon, I was able to code cool things with more mathematical and, therefore, easier-to-understand features like transforms. However, other areas of CSS, such as layout, have remained a constant source...

Overlapping Header with CSS Grid


Snook shows off a classic design with an oversized header up top, and a content area that is “pulled up” into that header area. My mind goes to the same place: Historically, I’ve done this with negative margins. The header has a height that adds a bunch of padding to the bottom...

First Steps into a Possible CSS Masonry Layout


It’s not at the level of demand as, say, container queries, but being able to make “masonry” layouts in CSS has been a big ask for CSS developers for a long time. Masonry being that kind of layout where unevenly-sized elements are layed out in ragged rows. Sorta like a typical...

Equal Width Columns in CSS Grid are Kinda Weird


Everything is flexible these days. If you write grid-template-columns: 200px 200px 200px;, sure, you’d have equal-width columns, but that’s a rare day. What you usually mean is three columns of equal fluid width. We’ve got fractional units for that, like grid-template-columns:...

Chromium lands Flexbox gap


I mentioned this the other day via Michelle Barker’s coverage, but here I’ll link to the official announcement. The main thing is that we’ll be getting gap with flexbox, which means: .flex-parent { display: flex; gap: 1rem; } .flex-child { flex: 1; } That’s excellent...

Exciting Things on the Horizon For CSS Layout


Michelle Barker notes that it’s been a heck of a week for us CSS layout nerds. Firefox has long had the best DevTools for CSS Grid, but Chrome is about to catch up and go one bit better by visualizing grid line numbers and names. Firefox supports gap for display: flex, which is great,...

Constrained CSS grids without `max-width`


Ain’t nothing wrong with max-width, but Ethan makes a point in the last sentence: Rather than simply defaulting to max-width as a constraint, I can use the empty space around my design, and treat it as a layout tool. If the space “around” your grid...

A Grid of Logos in Squares


Let’s build a literal grid of squares, and we’ll put the logos of some magazines centered inside each square. I imagine plenty of you have had to build a logo grid before. You can probably already picture it: an area of a site that lists the donors, sponsors, or that is showing off...

4 CSS Grid Properties (and One Value) for Most of Your Layout Needs


CSS Grid provides us with a powerful layout system for websites. The CSS-Tricks guide gives you a comprehensive overview of Grid’s properties with layout examples. What we’re going to do here is a reverse approach to show you the smallest possible set of grid properties you need to know to meet...

Careful with Nested `display: grid; height: 100%;`


It's not every day you can feel CSS be slow at something. Reddit user jgbbrd discovered nesting grid containers that all have 100% height can cause many-seconds of rendering delay. Probably not something you'll ever have to worry about, but still, interesting. From the comments: What a funny...

Nahoru
Tento web používá k poskytování služeb a analýze návštěvnosti soubory cookie. Používáním tohoto webu s tímto souhlasíte. Další informace