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
Julie Wolinsky
247 PointsImages
I managed to get a photo image on my homepage but it is huge. How do I size it? Thanks!
3 Answers
Chase Lee
29,275 PointsYou're definitely going to want to down size it in something like Photoshop.
If you want to keep the quality the try.
.image_class{
width: the_size_you_want;
height: the_size_you_want-too;
}
Hope that helps.
Justin Iezzi
18,199 PointsAnd to maintain proportions do something like this:
.image_class {
width: 300px;
height: auto;
}
You can scale your image by changing the value in the width property. The height property will make sure that your image's proportions are maintained. This is explained in greater detail as you go on. I'm fairly certain the Smells Like Bakin' project touches on this, so keep an eye out for that as it'll be specific to the setup.
Julie Wolinsky
247 PointsMuchas gracias!
Brenden Moore
738 PointsPhotoshop? Their is also a billion other ways to resize it with scripts but I personally like resizing and compressing the original most; to save on bandwidth/load-time.
Julie Wolinsky
247 PointsMany thanks!
Julie Wolinsky
247 PointsJulie Wolinsky
247 PointsThank you!