7 ms·
The fact that centering a div in CSS basically requires a doctorate is the entire reason I gave up on web dev.
by max-throat 3y ago
The fact that centering a div in CSS basically requires a doctorate is the entire reason I gave up on web dev.
- notfed 3y agoI empathize! It used to, but no longer, so give it another shot! :)
- dbbk 3y agoIf you think flex centering is the equivalent of "requires a doctorate" I'm not surprised you weren't cut out for web dev
- dylan604 3y agoSo for those of us that consider this dead simple, can we just start adding CSS Ph.D on our CVs?
- chihuahua 3y agoNo, you also have to throw away 3-6 years of your life.
- dylan604 3y agoI don't know about that. I'm not a UI person, yet I feel like I have a pretty good grasp on CSS. I actually like it. So when I'm sick and tired of programming things, I've found myself recreating the layout of some site I liked by writing the CSS/HTML by hand. You learn pretty quick that way. It's a shame that all UI is now only allowed to be done with some library or other.
- chihuahua 3y agoI was referring to the observation that getting a Ph.D. usually requires wasting 3-6 years of your life doing something tedious and useless (source: my time getting a Ph.D. in computer science)
- deathanatos 3y agoThose years were called "IE 6"
- dylan604 3y agowas it only 6 years? felt like 20. surely it didn't qualify for early release for good behavior
- deathanatos 3y agoMy comment was partly tongue in cheek. It did feel like 20 years, though. According to Wikipedia, it was initially released in 2001 … which … seems later than I remember? I don't remember upgrading to it, but I guess Win 98 came with IE 5? But +20 years would be 2021 so … I guess it wasn't quite. I was using Firefox by at least 2006, maybe 2007 at the latest.
- hirvi74 3y agoSuch venom. I am sure the GP was just trying to be comedic.
- Alifatisk 3y agoDamn, that’s a harsh response
- assimpleaspossi 3y agoAnd well deserved.
- tshaddox 3y agoIt requires single-digit minutes of work. I don't have a doctorate but I gather that it is rather more difficult.
- shp0ngle 3y agoIt's about as hard as in any frontend framework, native or non native.
- Someone1234 3y agoDid you read the article? Specifically the Flexbox example.
- icedchai 3y agoThe problem is it was easy to center things with tables. Then once CSS was popular, that was the "wrong way" to handle layout. I find CSS the worst part of web development, and it's what turned me off of front-end work. Glad flexbox has finally made things simpler again.
- autoexec 3y agoI like CSS but I'd agree that tables got a bad rap. They were very easy, very effective, and only occasionally turned into a nightmare of nesting that was impossible to maintain My problem with CSS now is that it's gotten too bloated to the point where it's introducing privacy and security risks. I really want an add-on that restricts CSS by default to only a sane subset of features.
- yreg 3y agoUsing tables for layouts is an accessibility nightmare.
- progmetaldev 3y agoThey're also awful to maintain over time, if you're needing to add new elements and require new columns or cells (and then there's the need to nest tables when using them for layout). I attempted to fix a website by adding closing table cells that were missing, and finally got the page to validate as XHTML Strict and Transitional. The entire layout shifted, and was completely based on those missing end tags.
- ryathal 3y agoit's really not. It requires adding a single attribute to tables that exist for layout.
- yreg 3y agoWhat attribute? And how do you affect the reading order? Say on a page with a side navigation?
- nicoburns 3y agoThe simple version is buried halfway down the article, but: .container { display: grid; place-content: center; } isn't so bad.
- mediumsmart 3y agoThe container is body, does not need a class in the simple version.