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

CSS

<div></div>

Hello. If i put <img> togther with <p> in <div class="report"> elements, the div's value doesn't affect <img>. For example: .report {width: 40%; } It affects <p> only. Why ? Please help me. Thanks beforhand.

2 Answers

Hi there

Can you post your code, and I'll take a look? Without that, suffice it to say that <img> elements are weird! They are inline elements, but behave as inline-block...

The best tip I can give you without seeing exactly what you're trying to achieve, is to set the img width value to 100%, and then change the display size using width values on the report div wrapper element. e.g. try setting img width to 100%, then report class to 25%, then 50%... 100%.... All the best Robin

Thank you bro . i have fixed it.