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

It is a good practice to give percentage widths using flex-basis to flex items or should I avoid using percentages?

-It is a good practice to give percentage widths using flex-basis to flex items or should I avoid using percentages at all costs while using flexbox and instead stick to absolute units and flex-grow?

-Will I have any conflicts long term if I use lots of percentages all across my layout while using flexbox?

Would really appreciate some help.

1 Answer

Steven Parker
Steven Parker
243,318 Points

The choice would be based on the content.

But assuming your content is appropriate for variable widths, percentages are a great way to make your page dynamically adjust to various window sizes.