2 ms·
There's no reason to not use CSS Grid, except for not knowing it well enough — and there's no reason not to learn it. Of those, only IE11 is relevant, as it's
by dictum 8y ago
There's no reason to not use CSS Grid, except for not knowing it well enough — and there's no reason not to learn it.
Of those, only IE11 is relevant, as it's a desktop browser, on wider and taller viewports.
Most of these browsers are mobile browsers on devices with narrow viewports, so even the default `display: block` fallback may be sufficient. If you have margins/paddings/widths etc which only make sense in the CSS Grid version, you can set these properties inside an `@supports` query https://developer.mozilla.org/en-US/docs/Web/CSS/@supports https://developer.mozilla.org/en-US/docs/Web/CSS/@supports
For IE11, it's a choice of presenting visitors with a slightly worse layout, to match the browser (https://philipnewcomer.net/2014/04/target-internet-explorer-10-11-css/ https://philipnewcomer.net/2014/04/target-internet-explorer-... or, if you use Sass or PostCSS, using mixins that output CSS Grid properties with Flexbox as fallback.
Its bugs are well-documented, and most have workarounds https://github.com/philipwalton/flexbugs https://github.com/philipwalton/flexbugs. Even inline-block can serve as a fallback, if you can avoid whitespace around tags in the markup (https://css-tricks.com/fighting-the-space-between-inline-block-elements/ https://css-tricks.com/fighting-the-space-between-inline-blo...)
A reasonable fallback doesn't need to match CSS Grid exactly. The whole point of media queries and responsive web design is that the website won't look exactly the same on all devices; it will look and work as good as it needs to look in that specific device.
- folkrav 8y agoMy last workplace's policy was to fully support the last couple version of Edge, Firefox and Chrome, but for IE11, it was "it won't be utterly unusable". That approach is becoming more and more commonplace, too. Reasonable fallbacks doesn't mean being perfect, either. I'll be honest anyway, most people still using IE11 these days are either literally stuck with it, or a pretty used to half the sites they visit to be a bit broken.