TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: For simple layouts, do I need CSS Flex or Grid?

2 pointsby swidiover 2 years ago
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?

4 comments

bhdzllrover 2 years ago
No, you don&#x27;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.<p>Here is a simple example without styling:<p><a href="https:&#x2F;&#x2F;jsfiddle.net&#x2F;3g71hLf0&#x2F;2&#x2F;" rel="nofollow">https:&#x2F;&#x2F;jsfiddle.net&#x2F;3g71hLf0&#x2F;2&#x2F;</a><p>And with some styling:<p><a href="https:&#x2F;&#x2F;jsfiddle.net&#x2F;3g71hLf0&#x2F;1&#x2F;" rel="nofollow">https:&#x2F;&#x2F;jsfiddle.net&#x2F;3g71hLf0&#x2F;1&#x2F;</a>
solardevover 2 years ago
By default divs are blocks. If you don&#x27;t want flex or grid, you don&#x27;t have to use them. In fact you don&#x27;t have to use CSS at all if you don&#x27;t want to. You can write plain HTML if you prefer.
approxim8ionover 2 years ago
I prefer flex, but that&#x27;s just because I&#x27;m more used to it, and I work a lot in angular where the angular-flex-layout shortcodes reduce effort a lot.
gardenhedgeover 2 years ago
I&#x27;m not sure about the future state of CSS but I choose to use Grid as often as possible these days.