I'm trying to figure out if there is something wrong that I'm doing or is CSS grid not supported in Safari (MacOS or iOS) even though everywhere they say it's supported?
I tried something like this:
ul {
list-style-type: none;
text-align: center;
}
.grid {
display: grid;
grid-gap: 20px;
}
.grid-4 {
grid-template-columns: repeat(4, auto);
}
<ul class="grid grid-4">
<li class="grid-item">
<img src="http://via.placeholder.com/350x150"/>
<a href="/">Browse Online, Buy in Store</a>
</li>
<li class="grid-item">
<img src="http://via.placeholder.com/350x150"/>
<a href="/">Browse Online, Buy in Store</a>
</li>
<li class="grid-item">
<img src="http://via.placeholder.com/350x150"/>
<a href="/">Browse Online, Buy in Store</a>
</li>
<li class="grid-item">
<img src="http://via.placeholder.com/350x150"/>
<a href="/">Browse Online, Buy in Store</a>
</li>
</ul>
It works fine in Chrome, FF and even on latest Edge, but not on Safari 10.0.1
The supporting browsers Other than in Internet Explorer, CSS Grid Layout is unprefixed in Safari, Chrome, Opera, Firefox and Edge.
Most developers are afraid to start using CSS Grid because of browser support, but CSS grid is fully supported in all main browsers: Chrome, Firefox, Safari, Edge including their mobile versions.
You can turn on the grid button located in the div which has display: grid declared. All you have to do is go to your browser's developer tools (mine is Microsoft Edge which is based on Chromium). You will see a button like this. And then you can code and test as you wish.
The most simple way to reset any CSS property to its initial value is to use initial value. It will work on any property and you won't have to worry about any property defaults. But in the current case 1fr and none will work as well, of course.
CSS Grid is only supported as of Safari 11.1 on Desktop and Safari 10.3 on iOS.
Ref: https://caniuse.com/#search=grid
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With