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

General Discussion

Images

I managed to get a photo image on my homepage but it is huge. How do I size it? Thanks!

3 Answers

You'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.

Thank you!

And 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.

Muchas gracias!

Photoshop? 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.

Many thanks!