Div Height = Image height. help

Joined
Feb 1, 2010
Messages
2
Reaction score
0
Hello All

I am having a problem to get my div height = image height. I have did some searching on this forum (can't post links since I'm a new member :( )

Unfortunately, the solution doesn't seem to be able to solve for my case.

My current Layout:

I have 2 divs

_____div1____|_____div2____|

I have used float:left to align div 1 and div 2 side by side. By placing an image within my div 1, part of the image is overlapping the area in div1. In other words, half of my image is appearing below of my div1 bottom border.

Hears the contents for my div 1:

<div id="msg-box">
blahh blahh blahh blahh......

<p><img ...></p>
</div>

I have tried using clear:both on <p style> but it doesn't solve the problem. Is there any solutions or alternative to cause my div 1 height to expand according to the number of images height totaled together ?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top