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

Videos in flexboxes touch each other before moving up/down a row despite declaring padding or margins

I hope this URL works because I'm working in Workspaces.

URL: http://port-80-ml6kbe826t.treehouse-app.com/

CSS: https://pastebin.com/pxKQR9Pa

HTML: https://pastebin.com/twBVdifq

Making embedded YouTube videos responsive requires putting them inside a container, making the container responsive, setting the videos to fill the container, and using padding-bottom to make the vids viewable at the right dimensions. For me, I want the vids' size to respond for smaller viewports, but a set size for larger ones. I've got that set.

Herein comes the problem. The vids' containers are flex children inside their flex parent. So, when the view screen grows/shrinks, the number of rows should adjust automatically. Typical flexbox behavior. However, when I adjust the browser, the videos won't move up or down until they are touching.

I've tried adding margins and padding, but no luck. I've tried everything I could think of following CSS Trick's Flexbox Guid, but no luck. I'm stuck. Please help.