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

HTML

stephanie harrison roberts
stephanie harrison roberts
1,713 Points

arrrgghhhh.......HELP (in other words, adding an image to a grid in a flexbox!)

Hi all, what should be SO simple has got me! I want to add different image to a grid ive made using a flexbox.....i cant get the images to show...what am I doing wrong?? Heres the html (the file paths are all on the same level, haven't put them in folders yet so its not the ../!)

<div class="flex-container"> <div class="flex-item" img src="lights.jpg" alt="image1"></div> <div class="flex-item" img src="lights.jpg" alt="image1"></div> <div class="flex-item" img src="personillustration.jpg" alt="image2"></div>

Thank you!

Steph

2 Answers

Antti Lylander
Antti Lylander
9,686 Points

Just put <img> tags inside your flex container.

<div class="flex-container">
  <img class="flex-item" src="lights.jpg" alt="image1">
  <img class="flex-item" src="lights.jpg" alt="image1">
  <img class="flex-item" src="personillustration.jpg" alt="image2">
</div>
Antti Lylander
Antti Lylander
9,686 Points

Happens to all of us. :) Happy coding!