4
Spent three hours trying to center a div with CSS
I was working on my first real project, a simple personal site, and wanted to center a box on the page. I thought it would take five minutes, but I messed up the flexbox rules. I kept trying margin: auto and text-align, but nothing worked right. After searching online and trying different things, I finally saw I had a typo in my class name. The whole thing took from 2 PM until after 5 PM to fix. Has anyone else lost a big chunk of time on something that seems simple now?
3 comments
Log in to join the discussion
Log In3 Comments
jessew8325d ago
Centering stuff in CSS is basically a rite of passage, right? The real question is how many hours we've all lost to a single missing semicolon.
2
betty_walker25d ago
Missing semicolons are a feature, not a bug.
8
blair63014d ago
Missing semicolons are one thing, but @jessew83, you're talking about hours lost. That seems like a serious debugging problem. My entire screen would have to be blank for that long to not find a syntax error. Are you just staring at the wall waiting for a sign? Maybe you need a better code editor that points out those mistakes right away.
2