Will CS Grid de­grade grace­fully in older browsers that don’t fully sup­port it?

net magazine - - EXCHANGE - Stephen M, Liver­pool, UK

As hyped as we are that CSS Grid has landed, only one third of browsers cur­rently sup­port it. Nei­ther In­ter­net Ex­plorer or Edge fol­low the cur­rent spec­i­fi­ca­tion, and you only have to go back a re­lease or two on other browsers such as Fire­fox, Chrome and Sa­fari to lose sup­port. TP: CSS fea­ture queries to the res­cue. All you need to do is wrap your grid rules in a @sup­ports (dis­play: grid) state­ment to ap­ply it con­di­tion­ally, and your fall­back code in @sup­ports not (dis­play: grid). When CSS Grid is univer­sal, you can re­move the fall­backs. This ap­proach will han­dle Edge and older ver­sions of the other browsers. De­grad­ing grace­fully in In­ter­net Ex­plorer 11 or older will re­quire some ex­tra work.

Squar­ing up CSS Grid en­ables you to lay out page items in rows and col­umns

Newspapers in English

Newspapers from Australia

© PressReader. All rights reserved.