Live data from Hacker News

Does CSS Grid Replace Flexbox?

css-tricks.com

31–32 of 32 posts

Re: Does CSS Grid Replace Flexbox?

#31
post #27

Earlier quoted context omitted.

That separation between markup and presentation language (CSS here) is exactly the point. Kicking all this stuff out into CSS means your markup can mean what you're trying to say. Using elements should mean you're defining a table with tabular data in it. These new bells and whistles don't change that. You'll still use for tabular data. And I'm not sure what you mean about native app development. We bitch and moan ab…

Why must a table be used in such a way, only for tabular data? Sorry if I seem obtuse, but I don't really see the purpose behind semantic elements. Tables were fine for layout with much fewer things that you needed to get right. Wikipedia still uses tables for the layout on the Main Page, for example. I don't think there is any 'meaning' in the tags that we use, and any meaning implied there is invented as a way to t…

HTML is not just about putting text on a screen. It is markup; the tags and attributes imply meaning about the contents they contain.

This makes it not only usable by a web browser, but parsable by software. That includes, but is certainly not limited to, screen readers, assistive technologies, and search engines.

Consider an example where I use JavaScript to make tags behave like links. I can make it “work”, but by doing so, I am disregarding—and breaking—a primary function of the language.

Re: Does CSS Grid Replace Flexbox?

#32
post #6

As a systems guy who only occasionally pokes his head into this web stuff: have we now completed the circle? For well over a decade I've seen generations of web hackers rail on about the evils of tables for layout. And now I look at this thing, and... it's a table. For layout. Oh sure, it's a table defined externally to the components. So your screen-reader enumeration of the document structure is unpolluted by the p…

Apart from the semantic issues that result when littering your HTML with tags that inaccurately represent the content they contain, Grid also provides features that tables cannot do:

  * overlapping cells (http://gridbyexample.com/examples/example15/)
  * empty cells, without a bunch of empty  tags (http://gridbyexample.com/examples/example12/)
  * size columns (or rows!) in proportion to one another
  * complex alignment of contents within a cell (http://gridbyexample.com/examples/example24/ and http://gridbyexample.com/examples/example25/)
  * specify exact min and max sizes for columns & rows
  * provide a full definition of responsive behavior, often without any media queries
It also provides everything a table does with far less code and easier to read markup.
Post reply on HN