88
incoming (lemmy.world)
all 17 comments
sorted by: hot top controversial new old
[-] NorthWestWind@iusearchlinux.fyi 15 points 1 year ago

I prefer flex

[-] onlinepersona@programming.dev 6 points 1 year ago

Is this a new CSS attribute?

[-] Muffi@programming.dev 5 points 1 year ago

Sound like you need to practice with some Flexbox Defense

[-] Swiggles 5 points 1 year ago
[-] FooBarrington@lemmy.world 6 points 1 year ago

There is actually an approach which makes this reasonably easy: https://mjml.io/

[-] Swiggles 2 points 1 year ago

That's actually cool. I have to remember it next time I have to deal with html mail.

[-] FooBarrington@lemmy.world 4 points 1 year ago

I'll pray for you that it doesn't come to that!

[-] Knusper@feddit.de 4 points 1 year ago* (last edited 1 year ago)

I only do webdev occasionally and yeah, I've noticed this tendency that I want to put everything in a CSS grid. At this point, I'm worried I end up with a layout that's about as responsive as the early-2000s table layouts. ๐Ÿ™ƒ

[-] adrian783@lemmy.world 4 points 1 year ago

grid and responsiveness are not antithetical. I mean the concept of grid had been around for like a decade, see bootstrap.

[-] Knusper@feddit.de 1 points 1 year ago

Yeah, I've done responsive grids before. Problem is, I'm currently working on a single-page web music player and it's so easy to just nail all the UI elements down. Like I might want to have the play button always appear to the left of the playback bar. But that obviously can't reflow naturally on smaller screens. Although reflowing that example won't look good either.

I guess, I'm still figuring out, if I ever actually want things to reflow. I might just need to define static rules, so that on a small screen, the play button should appear in a different grid cell, next to the previous/next buttons, for example...

Grid is made for responsive design.

If you're not familiar with grid, stick with flex, which kinda just works but doesn't have the strong control/structure as grid.

[-] PoolloverNathan@programming.dev 2 points 1 year ago* (last edited 1 year ago)

It's fine, my entire website is built on ~~rock and roll~~ grids.

[-] shira@feddit.de 3 points 1 year ago

Put it in another div, make that one display:flex;justify-content:center;

[-] Crow@lemmy.world 3 points 1 year ago

CSS grids are a godsend.

[-] Scrappy@feddit.nl 3 points 1 year ago

I always redo https://flexboxfroggy.com whenever I touch flexbox again.

[-] simonced@lemmy.one 2 points 1 year ago

set margin:auto to your div, and call it a day, no need of flex/grid whatever...

this post was submitted on 12 Sep 2023
88 points (100.0% liked)

Programmer Humor

19187 readers
1082 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 1 year ago
MODERATORS