5 ms·
You have hit on a major problem there. Stack Overflow was once the fount of all useful genius grade knowledge, but times change and some of the top answers are
by Theodores 8y ago
You have hit on a major problem there. Stack Overflow was once the fount of all useful genius grade knowledge, but times change and some of the top answers are plain wrong.
Take for example the 'how do I centre a div' type of question. You will get to find an answer with thousands of up-votes that will be some horrendous margin hack type of thing where you set the width of the content and have some counter intuitive CSS.
In 2019 (or even 2017) the answer isn't the same, you do 'display: grid' and use justify/align: center depending on axis. The code makes sense it is not a hack.
Actually you also get rid of the div as the wrapper is not needed if using CSS grid.
Now, if you try to put that as an updated answer you find there are already 95 wrong answers there for 'how do I center a div' and that the question is 'protected' so you need some decent XP to be able to add an answer anyway.
The out-dated answer meanwhile continues to get more up-votes so anyone new to HTML and wanting to perform the simple task of centering their content just learns how to do it wrongly. And it is then hard for them to unlearn the hack to learn the easy, elegant modern way that works in all browsers.
Note that the top answer will have had many moderated edits and there is nothing to indicate that it is wrong.
SO used to be amazing, the greatest website ever. But the more you learn about a topic the more you realise that there is some cargo cult copying and pasting going on that is stopping people actually thinking.
With 'good enough' search results and 'good enough' content most people are okay - the example I cite will work - but we are sort of stuck.
I liken Google search results to a Blockbuster store of old. Sure there are hundreds of videos to choose from but it is an illusion of choice. There is a universe of stuff out there - including the really good stuff - that isn't on the shelves that month.
Google are not really that good. They might have clever AI projects and many wonderful things but they have lost the ball and are not really the true trustees of an accessible web.
- tambourine_man 8y ago>you do 'display: grid' and use justify/align: center depending on axis. The code makes sense it is not a hack. It also doesn’t work on IE latest or Edge.
- v_lisivka 8y agoIt's another question: https://stackoverflow.com/questions/50475428/css-grid-is-not-working-on-ie-or-edge https://stackoverflow.com/questions/50475428/css-grid-is-not...
- Theodores 8y agoThe HTML is extremely naive in this question and I wouldn't expect it to work on any computer given the multitude of flaws. Just because the kid who can't walk on two feet can't ride a bicycle doesn't mean all bicycles are broken.
- Theodores 8y agoHave you been reading SO answers?!? It works fine in Edge. Why don't you try? IE latest - there is no such thing. The latest steam engines, the latest CRT screens and the latest buggy whips probably don't do CSS Grid either. IE exists for compatibility with enterprise apps but isn't 'latest'. It is legacy. And the content will still work even if CSS Grid is not supported, just the layout won't be perfect.
- andrewprock 8y agoChecking here: https://netmarketshare.com/browser-market-share.aspx https://netmarketshare.com/browser-market-share.aspx It looks like IE is still the #3 browser, ahead of both Edge and Safari.
- dcbadacd 8y agoHeavily depends on your target market, neither does it just hurt to say "This browser is unsupported for being too outdated" we do it for <noscript> why not <nopropercss> :/
- Theodores 8y agoInternet Explorer is a compatibility solution. It is there to run the old stuff. It is still kept secure but it is not getting any new features, there is Edge for that. The statistics you quote are meaningless. Go to another statistics provider and you will get different stats again. Include mobile and Safari suddenly becomes rather major. Supporting a depreciated browser is not the way to go. This has to be understood, the methodology of where the stats comes from is also mysterious, given how much of he internet is click fraud bots who knows what is what?
- deanCommie 8y agoThere are plenty of developers, myself included, that would prefer to approach tasks like this without having to ever lay our fingers on CSS.
- chachachoney 8y agoI'm not sure wether or not to apply Hanlon's razor to the W3C, but regardless, the W3C is to blame for this mess. Took us twenty years to get to Grid based layouts.
- dahart 8y agoAnd it’s a little ironic that JavaScript’s tongue-in-cheek namesake, Java, had grid based layouts in swing 20 years ago. OTOH, and to be fair, 20 years ago HTML was for newspaper / magazine like text layout, and grid based layouts are great for single page apps. The thing that’s happened more recently than 20 years is the web changed from text & media content in a static scrolling page layout to all pages are applications.
- Theodores 8y agoI consider wanting to center something a simple task. Yet the web makes it surprisingly counter-intuitive. So that was why I chose this as an example. I am intrigued as to how you do this simple centering task without using CSS - it is a web page we are talking about here, not some other application that has sensible layout tools. So please share what you know - it is a simple task - how do I center something - anything - vertically and or horizontally - in HTML without using CSS?
- tambourine_man 8y agoYou should change fields then. CSS is amazing and not going anywhere. It's one leg from the tripod letter soup (HTML, CSS and JS) on which the Web stands.