Css grid, it is a new thing but is it. Let's set up such a system. You can check out awesome examples on grid by example and build something awesome. But i also want to keep in mind some older users for this example. Older users who still use Internet explorer. They are there so why not.
Let us set up some css code. I did not use @supports queries because IE10 can use grid css but dos not know it it supports this.
The next thing is we want to set up some code we build with the
autoprefixer so we can build code and render
to IE10 and up. So we have to set up the {grid: true}
on the autoprefixer. Also when we
do this we can only prefix code IE10 gets. I tried to use
grid-template-areas.
But when i added some media queries IE did not listed. So i ended up with
grid-template-columns
and
grid-template-rows.
They do the same, but we have to be able to count to 10 sadly.
Let's go
Also set up some html. I also added some bootstap because we like bootstrap! I added the navbar fixed to the bottom and added a helper class on the larger displays.
And we are done, we built a simple grid based layout i would say anyone can see. Unless they are on very old browsers or browsers that just don't support grid. But for them we even have a mobile layout they can see on they (large) screen. So no harm done! Anyone can see our content.
Now we built a grid system you probably see on this page. It is awesome and you can use this. Get started with it and play around, just keep you users in mind on where to stop or where to play on!
The example here is to built systems and keep in mind there are older browsers on this world. Add
the
autoprefixer, add the {grid:
true}
and test where your code breaks, or keeps working. Newer browsers can do anything.
Also i found a nice article on what to do and check for grid layouts if you should try and use the ie implementation of css grid layout.
Also just check out the series on css-tricks.com. It can help you on your next project.
Now it is your turn to build something awesome!