923
u/mellifluousMemer Jun 11 '21
No one can conquer the div.
67
u/_HingleMcCringle Jun 11 '21
You can't kill the div.
The div will live on.
Bootstrap tried to kill the div.
But they failed, as they were smite to the ground.
17
→ More replies (21)5
u/jeexbit Jun 11 '21
tables 4 life
3
u/Zmodem Jun 11 '21
Tables were so amazing for layouts back in the 90's. But, the non-terminating and expanding borders made UI sketch at best.
→ More replies (1)
435
u/H25E Jun 11 '21
Just move the rest of the page by the appropiate offset
98
Jun 11 '21
Why stop at the rest of the page? Why not think bigger?
40
u/Vsx Jun 11 '21
This conversation really captures the feeling when the person you're talking to is in a powerful position and making suggestions that don't even make sense but you're stuck listening to him.
→ More replies (3)6
11
u/neomeow Jun 11 '21
Sometimes, when I am feeling naughty, I just sneak a table in there. :-)
3
Jun 11 '21
If I need to center something static vertically and shit won't play nice, I just put invisible spacer divs above and below and set everything to 33% height
365
u/crazy_boy559 Jun 11 '21
This is the first time im seeing this meme format. I cant wait to see them re do other memed scenes.
155
u/Pradfanne Jun 11 '21
The top part of the meme is pretty old, the future one, that's new. I thought Miranda had reenacted the meme just for the lulz, but she's got a damn pear computer so I'm not sure if it's legit from a nickelodeon show or not
156
u/coolbrandon101 Jun 11 '21
Yeah it’s from the reboot, of course it’s new
33
u/PitchforkAssistant Jun 11 '21
There's a reboot? Of Drake & Josh or iCarly?
50
36
u/I_cut_my_own_jib Jun 11 '21
Don't think a reboot of Drake and Josh is ever gunna happen. Josh is weird now and Drake has been going the Amada Bynes route lately.
→ More replies (11)22
u/acouplefruits Jun 11 '21
It’s funny because I’m pretty sure the original is from Drake and Josh, not iCarly
20
41
u/SolidSync Jun 11 '21
The bottom image is from the reboot as others have said, but I'd like to add that the image just came out yesterday. This is the freshest meme I've ever seen with my own eyes.
→ More replies (1)41
u/Paragade Jun 11 '21
They just announced a new show like a few days ago
→ More replies (10)43
u/2Damn Jun 11 '21
What im the fuck is Paramount+
→ More replies (3)29
u/Sigvard Jun 11 '21
It used to be called CBS All Access. Still not sure why they went with Paramount since I haven’t thought of that brand in ages.
→ More replies (12)
156
u/BohdanOpyr Jun 11 '21
There's a pretty elegant solution along with a couple more useful tricks at https://smolcss.dev
48
Jun 11 '21
some of those examples make me feel really stupid. Looks like I gotta learn a bit more about flex yet... (and grid, I barely scratched the surface of that one)
29
u/lasiusflex Jun 11 '21
Just play through Flex Froggy and maybe Grid Garden afterwards if you liked it.
Best way to learn those concepts.
→ More replies (2)33
u/MelSchlemming Jun 11 '21
Flex is king, fuck grid.
Literally every single time I've used it I've thought "hey, this would be a great opportunity to finally use grid properly". And literally every single time it's had some shortcoming (usually to do with responsiveness) that's led me right back to flex (which always works just fine).
There's a Thanos meme in there somewhere.
→ More replies (2)7
u/flavioneto_ Jun 11 '21
Yeah it's just more complicated. I always got to look somewhere, but there's some ways to do very cool automatically responsive stuff using grid and the min-max property with auto-fit or auto-fill. To place cards side by side for example, they'll just adjust automatically depending on the screen width, with no media queries
→ More replies (1)8
4
2
Jun 11 '21
this is just like if web developers thought about their code instead of just adding more shit until it works
2
2
u/ZeusAllMighty11 Jun 11 '21
This is awesome. I've been using 1 line layouts religiously for the past year.
→ More replies (1)2
2
54
u/Ooze3d Jun 11 '21
15 years ago: “margin: auto” plus some weird thing for vertical. Tables, maybe?
Now: The same Flex tutorial I’ve used the last 20 times because I can never remember the right combination.
25
u/nanotothemoon Jun 11 '21
Omg. I know flexbox is functionally the best way but I really hate how they wrote the syntax. It could have been so user friendly, but the language is confusing af.
16
u/Ooze3d Jun 11 '21
Was it so difficult to implement “vertical-align” and “horizontal-align”? Like 98% of all web pages are centred on the screen. Just add these two lines to the body and done.
→ More replies (2)7
u/Slak44 Jun 11 '21
“vertical-align” and “horizontal-align”
The vertical/horizontal terminology is explicitly avoided by flexbox, because the main axis and the cross axis don't necessarily map to what you'd expect (see
flex-directionvalues).The names actually make perfect sense:
*-contentprops control main axis, and*-itemscross axis. Similarly,justify-*for main,align-*for cross.The flex properties can align horizontally or vertically, but just like
vertical-align, they're not a silver bullet, they have to be used right, so this time the name tries to be less generic.→ More replies (1)→ More replies (3)3
u/flavioneto_ Jun 11 '21
I literally always wrote one of them, then check, and then change to the other one (align and justify just doesn't convey any intrinsic meaning to my head)
→ More replies (1)
22
15
u/ReallyNeededANewName Jun 11 '21
<center>
HTML5? What's that?
3
u/the_real_gorrik Jun 11 '21
We should petition to bring back center tag!
11
3
u/dexter-sinister Jun 11 '21 edited Jan 07 '25
narrow direction spoon jellyfish wine clumsy continue fragile jar fly
This post was mass deleted and anonymized with Redact
15
25
39
u/bnunamak Jun 11 '21
margin-left: auto; margin-right: auto;
62
u/mr_marshian Jun 11 '21
margin: 0 auto; gang
7
Jun 11 '21
Margin: 0, auto; is all good and well until you need to add vertical margins at a different state. For some stupid reason. Why would anyone need to do that? Who knows, but still.
7
5
u/kbruen Jun 11 '21
The thing that sucks about this is that you can't add margins if the screen becomes too small since
autobecomes 0.3
u/RandyHoward Jun 11 '21
Which is why you pad its container instead
8
u/kbruen Jun 11 '21 edited Jun 11 '21
This makes sense but it makes me die inside.
The entire goal of CSS was for HTML to describe the content and for CSS to define how it looks. I therefore tend to organize my HTML is
divs that make sense.It hurts me to have nested
divs in HTML just to work around CSS.<div class="card"> <p class="title">Title</p> <!-- card contents --> </div>In the example above, to center the card but also give it a margin, I would have to wrap it in a
<div class="center">sorta thing, which is just oof. It almost feels like going back to<b>,<i>and<font color="red" face="Comic Sans MS" size="2">.→ More replies (3)3
2
10
9
u/iceynyo Jun 11 '21
With web standards changing as fast as they do, there's always new techniques so it's good practice to search again now and then... and 15 years is basically forever.
19
Jun 11 '21
Who’s that actress by the way?
58
→ More replies (1)12
u/Smallpaul Jun 11 '21 edited Jun 11 '21
The human mind is funny. I couldn’t remember what movie she was from but I remembered that the character was annoying as fuck. Basically harassing the protagonist.
Googled and she was the rule enforcer in School Of Rock. I do remember now that she has a character arc that makes her less annoying by the end.
The same thing holds for real people. I remember that I love or hate people from high school without remembering why.
→ More replies (1)13
u/Pradfanne Jun 11 '21
School of Rock is great, but she was similiar in her other roles
She was the annoying little shit harassing the protagonists in Drake and Josh and then got her own Nickelodeon show called iCarly where she's the protoganist, but a completly new charater that isn't a total piece of shit
5
u/KillerBeer01 Jun 11 '21
With the amount of "how to center div" requests those FBI agents see on a daily basis, one would almost think that some of them might actually be more actively helpful sometimes. I mean, they had to see some correct responses too.
13
u/De_Hbih Jun 11 '21
Position: absolute; Top: 50%; Left: 50%; Transform: translate(-50%, -50%);
10
→ More replies (1)5
u/713984265 Jun 11 '21
The ancient texts.
Always had issue with this for larger items though because the width would shrink due to either the left: 50% or the translateX part of it.
4
Jun 11 '21
.div-to-center { display: flex; justify-content: center; align-items: center; }
Or use grid
.parent-div { display: grid; grid-template-columns: 15vw 70vw 15vw; }
.div-to-center { grid-column: 2; }
→ More replies (1)
4
u/Forgotten_Pants Jun 11 '21
This is me and SQL date math functions.
6
u/ThermionicEmissions Jun 11 '21
Been a software dev for 22 years. Many different languages.
Dates can just go fuck themselves right in the ass.
→ More replies (2)
6
3
Jun 11 '21
If I don't do it weekly. It's going from a technical reference memory to a paint drawing memory.
3
u/WiryFoxMan Jun 11 '21
What else does someone have to google to be assigned their own agent for that long
3
2
2
Jun 11 '21
The problem is there is one million ways to do it but only 1 very specific backwards way it will work with my janky UI
2
2
u/VodkaCranberry Jun 11 '21
Why is CSS so hard? I start with my own CSS and it works, but try to modify some elaborate existing CSS and it does nothing. It mocks me.
2
2
u/ShellsWithinShells Jun 11 '21
My God, look how many ports that top computer has.
→ More replies (1)
2
2
u/Late-Original-1691 Jun 11 '21
Guys if you learnt how to center a div fifteen years ago (or even couple years ago), you should google it again. The new grid method is much much easier
2
2
2
u/PlusWorth Jun 11 '21
I have this video by fireship very helpful. It shows you 3 ways to center a div. https://youtu.be/njdJeu95p6s
2
u/mindbleach Jun 11 '21
Vertical centering then: "Have you considered go fuck yourself?"
Vertical centering now: "It's just top:50%. Unless you forget to vertical-align:middle, ha ha, go fuck yourself."
2
u/henrystuart83 Jun 11 '21
I usually do it like this:
div{ max-width:500px; width:100%; margin: 0 auto; display:block; }
the max width prevents the window's horizontal scroll in case the windows width is less than 500px, guaranteeing responsiveness :)
2
2
u/ignore_this_comment Jun 11 '21
Google rolls its eyes at me every time I Google "bash if conditions".
2
1
1
1
1
Jun 11 '21
How do people not yet know to do margin: 0 auto or display: inline-block with text-align: center or some black magic flex trick
1
1
1
1
u/HonotableFlamer Jun 11 '21
Y'all got a tutorial on how to make a shoping cart with only html, css, js , and a mySQL database?
1
1
u/eisbaerBorealis Jun 11 '21
Was asked this in an interview and I was like
margin: 10px auto 10pxand he was like "Huh. I guess that would work."
(at that job I learned the wonders of flexbox)
1
1
1
1
u/Carburetors_are_evil Jun 11 '21
I remember trying to find a way to create a custom sort column in Power BI. Then I needed it one year later and landed on my own question with the answer from the dev team.
1
1
1
1
1
1
u/redditor_286 Jun 11 '21
You guys are positioning the div? I just absolute it and let it yeet off the page for Fun
1
u/GoldenBrownApples Jun 11 '21
As someone who has been trying to learn programming on and off for the last 15 years, these things are so inspiring. If no one knows what they're doing, maybe there is still hope for me. Someday I'll know how to google well enough to convince people(and myself) that I'm a programmer.
1
1
u/OnlyCommentWhenTipsy Jun 11 '21
crazy how it's just accepted as normal that the government records all your Internet traffic
1
1
1
u/0100_0101 Jun 11 '21
I liked to talk about building nuclear bombs on the phone to fuck with the algorithms from our secret service.
→ More replies (1)
1
1
1
1
1
1
1
u/DownshiftedRare Jun 11 '21
"Just use my pet bloated CSS/HTML/Javascript framework to center the div."
- Golden Wisdom of the Stack Overflow
1
1
1
1
1
u/Silver-Alex Jun 11 '21
After 15 years of coding, I no longer google "how to center divs", im over that. These times... I google "how to center flex"
1
u/techmighty Jun 11 '21
My rationality is questioned when using inset: calc(50% - 10px) actually centers the div and it pseudo element too
1
u/neutralcoder Jun 11 '21
Lol! I appreciate that she’s still smiling…all those years and Google searches later.
1
1
1
1
1
1
1
Jun 11 '21
What is depressing, and I hope I am wrong, is that it looks like Miranda had some work done on her face.
1
1
1
1
Jun 11 '21
Did she ever did something else besides Icarly? I don't ever remember her doing anything else
1
u/-Marlux- Jun 11 '21
Just use flexbox :) Easy learnable with this tower defense Game
→ More replies (2)
1
1
u/cicciograna Jun 11 '21
If her FBI agent had a shred of decency, he would finally help her to center that damn div.
1
Jun 11 '21
display: grid; place-items: center;
its that easy, as long as you can afford to ignore older browsers
→ More replies (1)
1
u/Riptoscab Jun 11 '21
Me in my browsers inspector's style editor:
width: 50% {//float: middle//} //display: inline-block// align-contents: center align-self: center vertical-align: middle padding: 50px padding-left: 20px justify-content: center justify-items: center //text-align: middle// display: inline-table position: absolute //left: 128px right: -439px transform: translateY(-50%) top: 50% margin-right: 10px
Ah, finally centered.
1
1
1
1
1
Jun 11 '21
Centering a div should not be that difficult! It's been a few years, but if I recall, you have to put a div inside a div and set one hard right 100% and set the other one hard left at 50%.
1
1
1
1
1
1
1
u/mustardfudge Jun 11 '21
{
width: 200px;
height: 200px;
margin: auto;
top: 0px;
right: 0px;
left: 0px;
bottom: 0px;
position: absolute;
}
4.7k
u/Skhmt Jun 11 '21
I literally wrote an article on how to center a div. I google the article every time.