Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
it doesn't work that way. you should know everything anyway. and float and flex and inline-block and even display: table. from the fact that you make the grid according to flex - this does not mean that in other places in the project you will not have to use float. or something else.
IMHO , but it's unlikely that anyone will disagree
with everyone's love of float. Sorry, they don't like it. How many articles have there been like "Float doesn't work for you either?", "float and css magic", etc.
Basically, float should be used for wrapping: https://jsfiddle.net/Ivanq/xqd0hoy7/
Often float is used to line up: https://jsfiddle.net/Ivanq/xqd0hoy7/1/
But such code cannot be supported . It's worth starting with the fact that float: right doesn't work quite the way you'd expect. This code will put first element 3, then 2, then 1.
For now it is better to use inline-block, it is supported by all normal browsers.
https://jsfiddle.net/Ivanq/xqd0hoy7/3/also aligns in a row, but with the help of inline-block. Of course, inline-block also has pitfalls, but in any case, float is better not to use.
This is IMHO.
Of course, you need to understand how it works, it’s better to typeset on flexbox if you don’t need support for old donkeys.
The question sounds something like this: "I started building a house. Is it worth bothering with the foundation, or should I immediately go to the ceiling?"
It is worth studying it so that you can forget it later and never use it :)
You must understand the principles of work, regardless of how useful this property is or not... For layout "on a live" project - definitely no floats or reduce their number to the minimum possible. There are many other options for aligning elements, and if float is not wrapping text around an image, in 95% of cases, this indicates that the layout designer simply does not know (read, does not know how) better solutions.
By the way, Float and FlexBox are cardinally different things, by the nature. FlexBox is about displaying/distributing content, while floats are floating elements that don't stretch or distribute in any way, let alone scale automatically.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question