Is it possible to completely abandon the use of float and inline-block and switch completely to flex ?
When it is correct to use one, and when another?
Thank.
Is it possible to completely abandon the use of float and inline-block and switch completely to flex ?
When it is correct to use one, and when another?
Thank.
You can refuse anything, the only question is why.
Firstly, it seems that this is not the purpose of these possibilities (which is completely different), but their use for the layout of a certain layout.
Each method has its pros and cons. Flexbox was not designed for layouts - it is quite flexible and convenient, but has a certain similarity with the tables, reduces manageability and increases processing time. It is not recommended to use it for complex blocks with many elements (for example, the layout of the entire page). However, I did not check this information.
Grid grids (display: grid) are intended for layouts. However, browsers still do not support them. We wait.
Inline blocks solve problems of vertical alignment and the provision of rows of elements. Convenient when you need to place the lines of elements of different heights. At the same time create problems with the spaces between them.
Float is often used for speakers and side panels. Causes the use of clearfix.
PS: Once again, I stress that the described is not the use of these features for their intended purpose.
Source: https://ru.stackoverflow.com/questions/491705/
All Articles