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 How to Make a Website Styling Web Pages and Navigation Make a CSS Image Gallery

css img fill permanent element

Can someone help me further?

2 Answers

set max width for all img to 100%

img {
  max-width : 100%;
}

Thank you!

Hello :) Most images are large in size and most of the time we want these images to be responsive. By being responsive...i mean that the images should be resized along with the browser's size. If these images are not responsive there would be hell of alot trouble for the people viewing that website in a mobile phone. He/She will have to scroll so much to view the whole image. To make the images responsive...we set the 'maxwidth' to '100%'

img {
  max-width: 100%;
}

Mark my answer as the best if i managed to help u

Thanks for taking time to explain it! :)