For a simple one-dimensional blog layout (header -> navigation -> content -> footer), do I need to use these new CSS APIs? Will CSS's default behaviour continue to work in the future, or are all sites expected to use these new systems?
Ask HN: For simple layouts, do I need CSS Flex or Grid?
1–5 of 5 posts
Re: Ask HN: For simple layouts, do I need CSS Flex or Grid?
#2I'm not sure about the future state of CSS but I choose to use Grid as often as possible these days.
Re: Ask HN: For simple layouts, do I need CSS Flex or Grid?
#3By default divs are blocks. If you don't want flex or grid, you don't have to use them. In fact you don't have to use CSS at all if you don't want to. You can write plain HTML if you prefer.
Re: Ask HN: For simple layouts, do I need CSS Flex or Grid?
#4I prefer flex, but that's just because I'm more used to it, and I work a lot in angular where the angular-flex-layout shortcodes reduce effort a lot.
Re: Ask HN: For simple layouts, do I need CSS Flex or Grid?
#5No, you don't need it if you use block-level elements (like div, header, nav, main, footer). Block elements always start on a new line and are therefore always one after the other in a column direction. This is part of HTML and will not go away.
Here is a simple example without styling:
https://jsfiddle.net/3g71hLf0/2/
And with some styling: