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 trialAishah Griffin
5,476 PointsSet 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">
3 Answers
Richard Hope
25,237 PointsOh, just noticed, you need to separate the style properties with a semi-colon, not a comma ie style="width: 250px; height:660px"
Aishah Griffin
5,476 PointsWow, thanks!
Richard Hope
25,237 PointsI 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.
Nishay Madhani
15,456 PointsHOW CAN THEY BE OF THE SAME SIZE IF YOUR WIDTH IS DIFFERENT FOR THE IMAGES
Aishah Griffin
5,476 PointsBad example. I gave the image that is offer a smaller size because it was larger.
Aishah Griffin
5,476 PointsAishah Griffin
5,476 PointsThere is no CSS added at the moment.