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

Design

Rashii Henry
Rashii Henry
16,433 Points

Resizing website images

when putting together a website.. you always have to deal with images that are various sizes.. is there a way to resize the image using css or do i have to use a photo editor to change the size before i put it onto my website?

2 Answers

Mike Gabriel
Mike Gabriel
8,402 Points

Resizing images via CSS only scales the original, leaving the full size to be downloaded by the browser. If you have an image that you want to always be 500x500px when displayed on screen, it would be best practice to design one to fit those constraints.

Kevin Korte
Kevin Korte
28,149 Points

This is one reason why I love using a CMS. Many of them have the ability to allow the the full size image to be uploaded on the back end, but will crop the image to the exact size you need for the page. This helps a ton with speed. You do not want to scale down a 1200x1600 image to a 50x50 avatar using CSS.

If you're not using a CMS, http://adaptive-images.com is a good way to accomplish the same things.

Rashii Henry
Rashii Henry
16,433 Points

what CMS's would you recommend? you seem pretty knowledgeable about web design. i might as well familiarize myself with it.

Kevin Korte
Kevin Korte
28,149 Points

Many of the CMS's how there fit for different purposes. Some are lightweight, some are set up more for blogging, others more of a blank CMS with less structure.

If you've never used a CMS before, I'd recommend starting with Wordpress; the reason being is there are currently two full project series here for Wordpress, one on setting up and using it, the other on creating a custom theme and content. Wordpress has a very simple and easy to use image feature. It can either crop or resize pictures to the exact specs you need on the front end, without actually editing the original picture. I'm sure most of the CMS's out there have this same feature as well built in.

Not a bad way to get your toes wet, as long as you keep in mind Wordpress isn't the best solution for every type of website.