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

HTML

Enormous pictures in html how do I make them smaller?

The pictures in my html are too large to look at, how do I make them smaller?

4 Answers

you could either write the code like this:

<img style="height: 50px; width: 50px" src="http://www.imagesource.com/">

or you can do what Shawn said and add a class and style it in css like this:

.image {
   height: 50px;
   width: 50px;
}

so for src="" what would go in the quotation marks? The image is a photo of some artwork my sister made taken from out phones.

One quick and easy way is to assign a class to your img tag and set the height and width in your css.

Thank you for your help. Your answers make sense to me and I have been trying them, one at a time then both together but its not working out.

Eric , With src="http://www.imagesource.com/"> am I supposed to be changing whats within quotations to where ever I got the image from?

Shawn, I think I may not be following you when you say assign a class to img tag. What would that look like? Is what your telling me look like the example Eric gave?

After much trial and error, I finally got it, thanks.