I have recently been learning a lot about flexbox, but one thing is still unclear to me. Should I always set the display
to flex
/inline-flex
, or is it ever advantageous to use block
/inline-block
?
I have found several useful articles, but none of the articles answer this specific question. This article explained the difference between the different display
values using flexbox instead of comparing them to display: block
. The question did state that using block
/inline-block
was outdated, but I haven't seen any other sources confirming that. If display: block
was now outdated, I would have thought it would say so on W3 Schools(not that they are always correct, but they seem to be a good source).
Several answers have mentioned this article, but again, it doesn't explain when display: block
should be used instead of display: flex
(if ever).
Other articles answering similar questions are this one and this one. While both are great articles. The first one gave advantages and disadvantages to both, but the only significant disadvantage of flexbox was browser compatibility which isn't a concern for this project. The latter article gave the best answer I saw which was that using display: flex
allows the element to retain flexbox properties. Does that mean that if it doesn't need flexbox properties I should just use display: block
? Does either have a performance impact, or should I just always use display: flex
?