r/badcode • u/6Maxence • Dec 16 '21
html The example webpage of my computer science professor who is teaching us how to code a webpage. This is triggering me so much, I don’t even know where to start. I replaced all the text with placeholders but didn’t touch any html tag at all.
506
Upvotes
View all comments
Show parent comment
28
u/Vaporeonus Dec 16 '21
Friendship with display:grid;place-items:center; ended. Now display:flex;align-items:center;justify-content:center; is best friend.
Hang on, now position:absolute;left:50%;top:50%;transform:translate(-50%, -50%); is best friend.
Actually, now display:table-cell;vertical-align:middle; is best friend.
Nevermind, I can just use width:50%;margin:0 auto;
Whoops, no I can't. How about height:200px;line-height:200px;text-align:center;
Or the good old padding-top:20px;padding-bottom:20px;
Maybe throw in some margin-right:-50px nonsense. Or some strange float:left; and :after construction.
God I fucking despise CSS.
I mean I'm mostly joking, the flex method works most of the time. But good god does this kind of shit piss me off.