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

Very new to flexbox, can someone critique my code?

https://codepen.io/anon/pen/VBLgXp?editors=1100

Please, ANY constructive criticism would be so appreciated.

2 Answers

Steven Parker
Steven Parker
231,261 Points

Two extremely minor suggestions:

If not also setting the "wrap", you might use "flex-direction" instead of "flex-flow".

You could use "align-items" on the #border instead of "align-self" on the h2. I only noticed it because "align-items" was used on .container.

Also, have you seen these additional fun learning resources for flexbox?

If I wanted a button below the border, with added space between, how would I approach that?

Steven Parker
Steven Parker
231,261 Points

So the button would be below (outside) of the #border element, but inside the .container?

You might set "flex-direction: column" on .container, and perhaps "justify-content: space-around". If that spacing was too generous, leave justify at "center" and just add a top margin on the button.