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

Set two images width and height with pixels but they are not the same size. Why is that?

<img src="1sthome.jpg" alt="Headshot 1" style="width: 250px, height:660px"> <img src="2ndhome.jpg" alt="Headshot 2" style="width: 300px, height:660px">

There is no CSS added at the moment.

3 Answers

Oh, just noticed, you need to separate the style properties with a semi-colon, not a comma ie style="width: 250px; height:660px"

Wow, thanks!

I believe your problem may be because img elements are inline by default. You can't add size properties to inline elements. Try changing their display property to either block or inline-block and the sizing properties should work.

HOW CAN THEY BE OF THE SAME SIZE IF YOUR WIDTH IS DIFFERENT FOR THE IMAGES

Bad example. I gave the image that is offer a smaller size because it was larger.