6
Unpopular opinion: Absolute positioning is ruining newbie layouts
I spent 6 months building a site in 2023 where everything was position absolute. Every div. Buttons, text, images, all manually placed with top/left values. Then I tried resizing the browser on my friend's laptop. Complete disaster. Stuff was overlapping, floating off screen. I realized I never once set up any kind of normal document flow. Took me 3 days to redo the whole thing with flexbox. Has anyone else fallen into this trap and had an insane fix afterwards?
2 comments
Log in to join the discussion
Log In2 Comments
the_sarah7d ago
Complete disaster" is putting it mildly my dude. You built a house with no foundation and were surprised when the walls fell down. I've been there too, spent a whole weekend manually repositioning a header that just would NOT stay put on mobile. It's like we all have to learn the hard way that position absolute is not a magic fix, it's a trap for people who think CSS is just guessing coordinates on a map. Flexbox feels like cheating after that nightmare, right? Just let the browser do the math instead of playing 4D chess with top and left values.
8
jesse847d ago
My buddy @the_sarah spent three days wrestling a sticky nav before realizing he never set a z-index.
7