Div Height = Image height. help

Discussion in 'HTML and CSS' started by muggslab, Feb 1, 2010.

  1. muggslab

    muggslab

    Joined:
    Feb 1, 2010
    Messages:
    2
    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 ?
    muggslab, Feb 1, 2010
    #1
    1. Advertising

  2. muggslab

    muggslab

    Joined:
    Feb 1, 2010
    Messages:
    2
    my post got ignored :(
    muggslab, Feb 1, 2010
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. HJ
    Replies:
    5
    Views:
    845
    Jonathan N. Little
    Sep 1, 2006
  2. K Viltersten

    <div ... /> and <div ...></div>

    K Viltersten, Mar 30, 2009, in forum: ASP .Net
    Replies:
    4
    Views:
    743
  3. Don Vaillancourt

    How to tell height of div where height is not set?

    Don Vaillancourt, Jan 28, 2005, in forum: Javascript
    Replies:
    8
    Views:
    145
    Dietmar Meier
    Jan 31, 2005
  4. Dwayne Madsen

    Q: Div A inside Div B is larger than Div B

    Dwayne Madsen, Jun 1, 2005, in forum: Javascript
    Replies:
    1
    Views:
    185
    David Dorward
    Jun 1, 2005
  5. marco_giuliani_it@hotmail.com

    Change height of DIV when div border set

    marco_giuliani_it@hotmail.com, Sep 21, 2005, in forum: Javascript
    Replies:
    0
    Views:
    123
    marco_giuliani_it@hotmail.com
    Sep 21, 2005
Loading...

Share This Page