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 trialJohn Pena
2,125 Pointsworking Media Queries, and everything resizes correctly when the viewport changes but the picture stays the same. Help!
I am working on an ebay post and I am using media queries. I specified two viewport sizes (max-width) at 700px and other at 480px. The text resizes well to the size I specified but the picture stays the same size. How can I make it to display correctly at 700px and 480px ?
Harry Beckwith
13,452 PointsDoes the image have a set width on it?
Also try setting in CSS
img { max-width:100%; }
This will ensure the image will be no larger than its container.
1 Answer
Sina Maleki
6,135 PointsHi You have to set the max-width of your img selector to 100%
img {
max-width: 100%;
}
Robert Richey
Courses Plus Student 16,352 PointsRobert Richey
Courses Plus Student 16,352 PointsWhat does your HTML and CSS look like? Without seeing the actual code, it's hard to know what's going on. When I write a simple media query, it works fine for manipulating an image.