Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Grid CSS layouts. Tell me the reasons to not use

Tags:

css

grid

Since I new with CSS, I just started to work with CSS Grid system. I would like to know if are there any technical issues in use CSS grids? I mean, which are the reasons for you to not use grid?

Thanks

like image 748
Old Castle Avatar asked Aug 11 '10 03:08

Old Castle


People also ask

Should I use CSS Grid Layout?

CSS Grid Layout excels at dividing a page into major regions or defining the relationship in terms of size, position, and layer, between parts of a control built from HTML primitives. Like tables, grid layout enables an author to align elements into columns and rows.

Why would you use a grid in layout design?

The grid system helps align page elements based on sequenced columns and rows. We use this column-based structure to place text, images, and functions in a consistent way throughout the design. Every element has its place that we can see instantly and reproduce elsewhere.

Is CSS grid better than Flexbox?

If you are using flexbox and find yourself disabling some of the flexibility, you probably need to use CSS Grid Layout. An example would be if you are setting a percentage width on a flex item to make it line up with other items in a row above. In that case, a grid is likely to be a better choice.

Should I use table or grid CSS?

If your intention is to display a table, an HTML table is your way to go. If your goal is to lay out content on a webpage, CSS grid is one way of doing that. It doesn't have perfect browser support yet so you might want to consider another option for layout, but it is an option. Tables were never meant for layout.


2 Answers

Flexibility

Once you start using the grid, you are stuck with it. Any other issues you might wind up finding you will have to conform to.

In my opinion (and every other designer I've talked to) it is far easier to simply define your own columns and default sizes as classes and apply them as-needed. A custom grid if you will. Then changing the styling is as easy as changing a line or two of CSS, instead of either re-generating the grid system or redesigning the site and sacrificing in order to use the grid.

I'm a fan resets and some minor love from Blueprint (especially the Typography), but that's about it.

like image 176
Josh K Avatar answered Nov 15 '22 07:11

Josh K


I've just started using object oriented CSS (OOCSS). I'm really enjoying it because it provides a very basic and minimalistic grid system. It allows you to create relative sized grids by dividing an element into halves, thirds, fourths, or fifths. The divided elements are infinitely nestable.

OOCSS is more of a philosophy than a framework. It's all about how you extend a very basic foundation.

Check out these links:

http://oocss.org/ http://developer.yahoo.net/blogs/theater/archives/2009/03/website_and_webapp_performance.html http://www.youtube.com/watch?v=j6sAm7CLoCQ

like image 21
Bryan Downing Avatar answered Nov 15 '22 05:11

Bryan Downing