#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2001
    Posts
    4
    Rep Power
    0
    Can any one help me with this div layer problem?
    This is what i'm trying to do:

    Left align an image in a div layer to wrap text around it.

    This is what happens:
    Div layer seems to ignore the height of the image.
    Div layer height seems to be governerd by the depth of the text
    See here for an example: http://www.kelseysmith.co.uk/dhtml/

    Many thanks,

    Kelsey
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2001
    Location
    Vancouver, WA
    Posts
    49
    Rep Power
    14
    Hi Kelsey,

    I have a couple solutions, and no good explanation for why they work.

    Solution #1:

    add a height definition to your style definition for .box1:
    Code:
    .box1 { 
    	BACKGROUND-COLOR: #d8d8d8;
    	BACKGROUND-IMAGE: url(black2x2.gif);
    	BACKGROUND-REPEAT: repeat-x;
    	height:10px;
    }
    Believe it or not, it doesn't appear to matter what you set the height to!

    This appears to tell the div that it should wake up and at least start thinking about height.

    Solution #2:
    remove the outer Div (where you set the width to 250px) and set the width:250px in .box1 again.

    Now... do you want to start to think about Netscape 4.x? Because this does not work for NS 4.
    --
    John Sturgeon <><
    johns@senareider.com
    http://www.senareider.com/technology.php

IMN logo majestic logo threadwatch logo seochat tools logo