Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

CSS auto hight query

  • 23-06-2006 02:27PM
    #1
    Registered Users, Registered Users 2 Posts: 3,514 ✭✭✭


    Hi,
    I have a div which contains a background image. Within that div i want to place a few more divs which will contain images. The problem i'm having at the moment is that when i add images to the divs, the main div does not adjust it's height to fit them in. So i have an overlapping div.

    This is the css for the larger div
    #Layer9 {
         position: absolute; left: 98px; top: 344px; width: 771px; height: 600px; z-index: 9;
         background-image: url(blue_layout_imgready_09.gif);
         background-repeat: repeat-x;
         margin: 0px;
         padding: 0px;
    

    and this is a sample of the inner divs
    #Layer24 {
        position:absolute;
        width:1px;
        height:auto;
        z-index:2;
        left: 460px;
        top: 236px;
        background-image: url(advert_border.gif);
    }
    

    I wouldn't be too much of an CSS expert so the problem is probably easily resolved. Thanks


Comments

  • Registered Users, Registered Users 2 Posts: 3,594 ✭✭✭forbairt


    hmm if you want to throw up the sample code I can take a quick look at it ...

    failing that ... after all the final internal div put in a
    <br style="clear:both;" />
    

    edit: I should say throw up the sample page ? ...

    edit edit: ... you've them all positioned absolutely ... this means the parent div doesn't actually know where its internal divs finish


  • Registered Users, Registered Users 2 Posts: 3,514 ✭✭✭Rollo Tamasi


    thanks for the offer, i'll send you on a lick to the url via PM's
    I'm not sure what value the position should be, i tried putting height auto but it didn't work either.


Advertisement