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
nl9
1,478 Pointsadding my own pictures, having trouble with pixels
HI! I'm trying to add my own pictures to my site, but i can't get the pixels to be right, so the pictures aren't the right size... anyone have any suggestions? i tried in preview tools to customize the pixels, but when i moved it to workspaces, it went back to original form.
Blake Provenza
Courses Plus Student 3,461 Pointstry using percentages instead of pixels!
2 Answers
jason blesing
256 Points<img src="" size="" width="" height="">
Maybe try modifying some of them in css
img {
size:20px;
}
Nicholas Hebb
18,872 Pointsimg doesn't have a size attribute. If you want it unscaled, you can leave out height and width altogether. However, if you want a gallery, then a common technique is to have a containing div that has its width set to a percentage based on the number of items in a row, then set the img CSS to width: 100%; height: auto;
Nicholas Hebb
18,872 PointsNicholas Hebb
18,872 PointsCan you post your html and style (inline, page level, and css) for the img element?