CSS CSS Flexbox Layout Flexbox Properties Smarter Layouts with flex-basis and flex

guram dgebuadze
guram dgebuadze
Front End Web Development Techdegree Student 4,121 Points

flex-basiis

can someone help i cant get what it does with auto, initial, 0, integer or etc. what's the differences? (this lesson is so uninformative)

3 Answers

Steven Parker
Steven Parker
155,492 Points

Even MDN, my usual go-to reference, is a bit vague on this; but it does describe the amusing history of the "auto" setting. Apparently even the creators weren't sure what it should do and changed it a few times. See the MDN page on flex-basis.

Another good source of information is A Complete Guide to Flexbox on CSS Tricks.

But some time spent experimenting on a sandbox tool may be more valuable than any documentation.
My favorites are:

Steven Parker
Steven Parker
155,492 Points

That just means there's no minimum, so it fits the contents.

guram dgebuadze
guram dgebuadze
Front End Web Development Techdegree Student 4,121 Points

auto also fits content when there is no size determined, but items look differently what is the difference.