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

Image position and size

I am working on the Treehouse unit2 project, all things are doing great, but there is only one problem that i couldn't fix. There is text and img, i want the text stay 50% of page at the left side and this works, but when i set the img width at 50%, it does take up 50% of page. The problem is the img getting bigger, i want the image stay original sizes without stretching. And when i float the img to right, it is hard for me to place the img beside the text. So, i hope someone can help me out. Thank you so much and waiting for your reply!!!

2 Answers

Have you set the height of the image to auto?

Thank you for your reply!! But I already found the solution!! If i have another question, i will ask again, thank you so much!!

Steven Parker
Steven Parker
229,967 Points

For the benefit of future readers, you might want to explain what solved the issue. :wink:

Ok, actually I just adding the padding around the text, then float the image to the right, finally I give the image some margin, they stay side by side perfectly. Thank you for your replying, because I have lot things to do, so I forget to reply it. Thank you so much.