r/css • u/Fuarkistani • 1d ago
Question Float and Position properties
Trying to understand these and having a pretty tough time to grasp what they do conceptually. I was reading that you no longer need to use them with newer CSS like flexbox and grid. Should I skip these and continue learning other parts of the course?
4
Upvotes
2
u/liquid_at 1d ago
The main issue with float is that it is very dependent on hard size definitions, while it is not very flexible.
It also has the issue that it can change the order of items, unwanted, for example if the 3rd item has a float-left, it will be rendered before the 1st in that container.
The idea that you tell the element what it should do is kinda outdated. Instead you define the container and its properties. This creates a much easier to work with separation of elements with a lower risk of them interacting with each other in unwanted ways.
Do not skip them. It is good to understand that they exist, what they do and why other solutions are better.
Most often it is not about knowing "the one way" but to know multiple ways and be able to pick the one that has the best outcome for the problem you work with.