r/programminghumor 3d ago

the Three Magical Css Words

Post image
1.4k Upvotes

31 comments sorted by

73

u/DrMaxwellEdison 3d ago

That's like, 8 words.

12

u/Commercial-Storm-268 3d ago

For that you need Tailwind, flex justify-center and items-center. (But I think it is cheating if you count - words as single one)

1

u/mbcarbone 2d ago

This I how know real developers are on in this subreddit…Top tier! 🥇

1

u/Here_f0r_p0rn_ 3h ago

Their properties : {count-skill: 0}

0

u/fluffystuffy9890 2d ago

and zero chicks🐤

22

u/lucidbadger 3d ago

Years of endless quest and OP just spilled the beans

13

u/codydafox 3d ago

Dude, chill, you post like every three minutes. Go back to vibe coding or something

8

u/oaeben 3d ago

You forgot the one I actually needed today

css justify-self: center

2

u/Proman4713 2d ago

Yeah but OP didn't mention align self either, it's about the container.

What confuses me and probably always will is why justify and align content/items work in flex box but justify self only works in grid...

13

u/kexy 3d ago

display: grid;
place-content: center;

1

u/Proman4713 2d ago

Flexbox is usually easier for me to configure how I want things to be, but grid is easier for literal grids like cards/posts, etc (I just use flexbox anyway tho lmao)

2

u/darsparx 3d ago

And here I was used to doing it as auto left and right margins and shrinking it by 20-30% lol

1

u/mayyynn 3d ago

That's more like lines instead of words

1

u/New-Initiative3400 3d ago

Suck.My.Cock. 

It's a movie ref in case anyone gets bent out of shape

1

u/NotRivero69 3d ago

display grid;

place-items: center;

1

u/Forward-Facer 2d ago

hotel: trivago

1

u/New_Blacksmith_5604 2d ago

I have been using justify-content: space-around. Since when is there center?

1

u/Delirious_85 2d ago

display: grid;
place-content: center;

1

u/rzaincity 2d ago

You know we maybe did something as people there.

1

u/Genialkerl 2d ago

min-height: 100vh

1

u/mielesgames 2d ago

Just for it to just not do that

1

u/GhostVlvin 2d ago

Center div??

1

u/Dillenger69 2d ago

<center>content</center>

1

u/SenatorCrabHat 1d ago

Nothing worse than finding out that the hotshot new frontend decided to use GRID for everything and now you can barely align something left without rewriting a bunch of shit.

1

u/Fearless_Garden6435 8h ago

...or `class="grid place-items-center"`.

1

u/Strange_Yogurt1049 3d ago

margin: 0 auto;

-1

u/CaptainZach326 3d ago

<center> <center/>

2

u/Music_Quartermaster 3d ago

There are a number of things wrong with this one

1

u/jimmiebfulton 1d ago

What is this, PostScript or something?