Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

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
229,644 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.