74 points

Weird flex, but ok

permalink
report
reply
6 points

Hehe.

I see what you did there.

permalink
report
parent
reply
3 points

It’s not weird, it’s powerful!

permalink
report
parent
reply
29 points

Hell, I’m a web dev and I’d pay someone to center things for me

permalink
report
reply
22 points
*
Deleted by creator
permalink
report
parent
reply
3 points

Same! I usually open the dev console and just flip through all the options until I find the one that does it

permalink
report
parent
reply
8 points

<center></center>

That’ll be 200 dollars

permalink
report
parent
reply
1 point

Great, now make it blink.

permalink
report
parent
reply
1 point

I still use \ tags on some things, it’s quick and I’ll fix it when it eventually breaks

permalink
report
parent
reply
3 points

For real. When I have a front-end story to do, I basically just slam on the keyboard until it looks close to how UX wants it.

permalink
report
parent
reply
1 point

Co-pilot?

permalink
report
parent
reply
25 points

I don’t do web dev, I write math software that makes very rich people richer. But I often hear of this centering and layout crap

Why doesn’t html just have hcenter and vcenter tags or something? Why is centering so hard?

permalink
report
reply
20 points

HTML has moved on from non-semantic tags a long time ago, and centering is easy with modern CSS.

permalink
report
parent
reply

Since when does HTML not have a simple centering tag?

Edit: Since HTML5 apparently. Wow wtf?! I haven’t actually used HTML since I was in high school. That’s wild.

permalink
report
parent
reply
2 points

As a frontend dev: who knows?

permalink
report
parent
reply
19 points

Centering things on a web page is so easy.

I also have to look it up every single time.

permalink
report
reply
10 points

I wasn’t expecting this to work, and yet it does: https://css-tricks.com/the-peculiar-magic-of-flexbox-and-auto-margins/

When Sam says, “that item will automatically extend its specified margin to occupy the extra space in the flex container,” the way my empty filing cabinet brain interprets that is like so:

Setting the margin property on a flex child will push the child away from that direction. Set margin-left to auto, the child will push right. Set margin-top to auto and the child will push to the bottom.

[…]

Why is this useful to know? Well, I think there are a few moments where justify-self or align-self might not get you exactly what you want in a layout where using auto margins gives you that extra flexibility to fine-tune things.

permalink
report
reply

Programmer Humor

!programmerhumor@lemmy.ml

Create post

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

  • Posts must be relevant to programming, programmers, or computer science.
  • No NSFW content.
  • Jokes must be in good taste. No hate speech, bigotry, etc.

Community stats

  • 3.6K

    Monthly active users

  • 1.5K

    Posts

  • 35K

    Comments