I am not allowed to credit the site that has this disaster. Its owner said “Nobody should see that”

You are viewing a single thread.
View all comments View context
46 points

Bro its so easy bro, just use flexboxgridcolumns its been a standard since 2010 just flex it bro you haven’t learned to flex yet just check w3c schools and add a flex you can polyfill it but don’t use that hacked one use the good flexpolyfill then { content-align-middle-child-elements: center-middle-true-neutral } so easy with flex bro

permalink
report
parent
reply
1 point

It’s 2024 and flexboxes still don’t work that well with vertical direction and wraparound…

permalink
report
parent
reply
1 point

Do you have an example?

permalink
report
parent
reply
2 points

Sure. Here you go. The green container should cover all red boxes in both cases. I’ve been bashing my head against this issue for a while, but, as far as I understand, this is a bug that’s never going to be fixed. Which sucks, because I wanted to re-design some of the apps in the horizontal metro-style scrolling manner for the bottom screen on my zephyrus duo, but this effectively prevents me from doing so (Unless I use grids and set positions manually).

permalink
report
parent
reply
10 points

Dude, stop flexing on him. You’re gonna make him cry.

permalink
report
parent
reply
17 points

I know you meant this sarcastically, but yes, flex is a good option for centering something. Either that or setting the left and right margins of the element to auto, which is generally even easier.

Basically, if you’re in a flex container use flex, if you’re in a grid use grid, and if neither of those apply set the left and right margins to auto.

permalink
report
parent
reply
6 points

Also seriously, anybody having problems with flexbox should try this:

https://flexboxfroggy.com/

I’m not sure there’s any version of it for grids, but IMO grids are inherently more intuitive, so it may not be needed. Flexbox is the one that is hard to learn.

permalink
report
parent
reply
2 points

Also exists as Tower Defense

permalink
report
parent
reply
3 points

I don’t know any CSS (despite reading memes about it like this) but I do know that the bottom of that page has a link to something called Grid Garden

permalink
report
parent
reply
3 points

Well, flexbox and grid have different purposes in my opinion/experience. Personally I use grid for “top level” layouts like the layout of the whole site, while I tend to prefer flexbox for layouts inside the grid. Of course that’s just a rule of thumb, there are absolutely cases where this isn’t the best option.

permalink
report
parent
reply
10 points

You’ve perfectly captured twitter tech bro energy it’s kind of incredible actually

permalink
report
parent
reply

Programmer Humor

!programmer_humor@programming.dev

Create post

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

  • Keep content in english
  • No advertisements
  • Posts must be related to programming or programmer topics

Community stats

  • 2K

    Monthly active users

  • 861

    Posts

  • 14K

    Comments