Jump to content

CSS grid layout

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by GifsAndJpegs (talk | contribs) at 05:08, 7 October 2017 (Initial creation of page with 3 sections, an image, and 6 references.). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)


CSS Grid Layout is a technique in CSS that allows web developers to create complex responsive web design layouts more easily and consistently across browsers. [1] There have been other webpage layout methods used previously including tables, the box model, and CSS Flexbox. It is currently a W3C Candidate Recommendation despite already being adopted by most major browsers. [2]

Advantages

A depiction of a typical webpage layout using CSS floats.

CSS Grid can create more asymmetrical layouts than previous grid and layout options like CSS floats. It also allows for more standardized code that works across browsers. This is in contrast to relying on specific browser hacks or complicated workarounds.

One issue with using floats in CSS is if content gets added to one portion of the page it could disrupt the flow of the page and break the layout. This is due to the varying heights for layout elements.

Browser Support

As of October 2017, Chrome, Firefox, Safari, and Edge all support CSS grid without vendor prefixes. [3][4][5] Web developers targeting older browsers can utilize Modernizr 3.5.0 to detect and gracefully degrade the webpage as needed. [6]


Utilization in Frameworks

There are no current web frameworks that incorporate CSS Grid in contrast with Flexbox which is used in frameworks such as Bootstrap 4 and Foundation 6. [7]


References

  1. ^ "CSS Grid – Table layout is back. Be there and be square". Google. Retrieved 6 October 2017.
  2. ^ "CSS Grid Layout Module Level 1".
  3. ^ Anderson, Kareem. "Microsoft's newest browser gets a significant boost with EdgeHTML 16".
  4. ^ Protalinski, Emil. "Chrome 57 arrives with CSS Grid Layout and API improvements | VentureBeat". venturebeat.com.
  5. ^ "Can I Use - CSS Grid".
  6. ^ Ates, Faruk. "Modernizr 3.5.0".
  7. ^ "Flexbox grids and frameworks".