Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

CSS CSS Flexbox Layout Building a Layout with Flexbox Creating a Three Column Layout with Flexbox

Anwar Rizalman
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Anwar Rizalman
Python Development Techdegree Graduate 33,620 Points

Regarding the order of shorthand flex property

So in this video the flex-basis value is set to the second value of the flex property. The previous video about the flex property also did the same thing as assigning flex-basis to the second value in the shorthand flex property. However, in the css-tricks.com complete guide, the flex is a shorthand for flex-grow, flex-shrink and flex-basis and thus the default value is 0 1 auto.

So I assume the article on css-tricks is outdated or misinformation? Can anyone clarify me on this one?

1 Answer

Steven Parker
Steven Parker
215,939 Points

The flex shorhand has "smart setting".

So even if you only have one or two values, if there is a unit of measurement in the value, it knows to apply it to flex-basis, since the other values are unitless.