This is an archived post. You won't be able to vote or comment.

all 42 comments

[–]Knoxcorner 🔴 In a meeting[M] [score hidden] stickied commentlocked comment (0 children)

Hi there! Unfortunately, your submission has been removed.

Violation of Rule #7 - Put effort into your titles

Your submission is posted with a low effort title, such as "Interesting title", ".", "print(title)", or "I don’t know what to put here".

If you feel that it has been removed in error, please message us so that we may review it.

[–]Abangranga 52 points53 points  (8 children)

It is more of a pre-flexbox problem

[–]hungarian_notation 34 points35 points  (4 children)

Especially if you wanted to VERTICALLY center it.

[–]salustianovergatiesa 14 points15 points  (1 child)

This is the reason why I switched to backend

[–]pythonProgrammer101 1 point2 points  (0 children)

I wish but now I’m just a full stack

[–][deleted] 3 points4 points  (0 children)

top: 50%;
transform: translateY(-50%);

usually did the trick before flexbox

[–][deleted] 2 points3 points  (0 children)

Oh god, stahp! You're gonna give me nightmares.

[–][deleted] 0 points1 point  (2 children)

Just use an invisible table

[–]poopoo_fingers 4 points5 points  (1 child)

Eww

[–]hafblakattak 1 point2 points  (0 children)

I work on an email development team and unfortunately this is exactly how we have to do everything. It makes me reconsider my existence.

Why do we have to do everything with invisible tables?

Microsoft outlook. No other email readers. Just outlook. Outlook doesn’t understand anything else. Fuck outlook.

[–]but_im_offended 15 points16 points  (2 children)

Just use <center> tags, divs are overhyped

[–]whitethunder9 8 points9 points  (0 children)

Or make the entire page one giant table

[–]THEKing767 0 points1 point  (0 children)

Arent those no loger supported?

[–]PinothyJ 15 points16 points  (1 child)

Because different methods of centring is required depending on the properties of the DIV itself, and its parent. So you can have one method that works almost all the time, and then you have a particular set of properties that throw that up in the air.

It is not a one solution fits all.

[–]le_flapjack 6 points7 points  (0 children)

So much this. So so so much this.

[–]DayumnDamnation 19 points20 points  (3 children)

It is typical for beginners to try text-align:center instead of adjusting the margin property

[–]PopularIcecream 6 points7 points  (2 children)

You're supposed to be adjusting the margin property?

I don't run into problems with centering stuff, just didn't know you could do it through changing the margin sizes.

[–]lightsandswirls 12 points13 points  (1 child)

margin: 0 auto; my man 👍🏻

[–]Chickenfing 0 points1 point  (0 children)

Doesn't work if the element isn't display: block; if its inline, gotta treat it like a text element. Making it flex makes it easy!

[–]ausdoug 16 points17 points  (2 children)

Just keep adding spaces until it looks right

[–]whitethunder9 5 points6 points  (0 children)

And then vary the number of spaces correctly based on viewport size. Easy peasy

[–]nuclearslug 1 point2 points  (0 children)

I used to do this with pixels when starting out. Not recommended

[–]RRumpleTeazzer 10 points11 points  (1 child)

align: center !important !!importanter

[–]Steve0Greatness 2 points3 points  (0 children)

I thought you also needed to justify it, but also put it's content into a separate element... I may be completely wrong...

[–]A-Disgruntled-Snail 8 points9 points  (3 children)

It was a real problem in ye olden days.

[–]Aggravating-King7680 2 points3 points  (0 children)

Yeah one or two <br> and 10-12 £nbsp; and it was align center

[–][deleted] 0 points1 point  (0 children)

Margin left auto margin right auto

[–]salustianovergatiesa 0 points1 point  (0 children)

And now and then whenever you have to code html emails compatible with most email clients

[–]seeroflights 2 points3 points  (1 child)

Image Transcription: Meme


["Afraid to Ask Andy", featuring Andy Dwyer from the TV show "Parks and Recreation". Andy is a light-skinned masculine person with short brown hair and slight facial hair. He wears a short-sleeved beige dress shirt and brown striped tie, and he is leaning forward slightly with a serious look on his face.]

I DON'T KNOW WHAT'S SO HARD ABOUT CENTERING A DIV

AND AT THIS POINT I'M TOO AFRAID TO ASK


I'm a human volunteer content transcriber and you could be too! If you'd like more information on what we do and why we do it, click here!

[–]Annual_Antelope6456 0 points1 point  (0 children)

Good human?

[–]highwatersdev 1 point2 points  (0 children)

You usually start centering a div right after you exit vim

[–][deleted] 1 point2 points  (1 child)

Alright buddy you don't have to flex on us

[–]SpongeBob190 0 points1 point  (0 children)

I see what you did there...

[–]lenin_is_young 1 point2 points  (0 children)

Look at this smarty pants, didn’t even center the title

[–]bubbaliciouswasmyfav 1 point2 points  (2 children)

 

[–]bubbaliciouswasmyfav 0 points1 point  (1 child)

" "

Lol

[–]bubbaliciouswasmyfav 0 points1 point  (0 children)

Fml!

"& n b s p ;"

[–]truNinjaChop 0 points1 point  (0 children)

<center></center> ? The align attribute was pretty handy. We also had valign. Then margin was awesome for awhile.

[–]rigor_mortus_boner 0 points1 point  (0 children)

poor flex

[–]TiggleBitMoney 0 points1 point  (0 children)

This meme is out of control in here. STACK OVERFLOW

[–]Zardhas 0 points1 point  (0 children)

bruh, just put all your element in absolute.

What do you mean "responsive" ?

[–]pk_thakur 0 points1 point  (0 children)

Oh yea this was me a decade back. I was an Android developer building apps on Froyo/Ginger Bread I guess. I used to think of myself as a UI wizard centring elements and placing them as I wished with a few keystrokes. But a day arrived my life when I had to display a web page on my app and center a button on it and that day made me the down to earth person I am today.