Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Mar 2005
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    min-height of div determined by image?

    i've been reading how ie doesn't support min-height and some related things, and am looking for a workaround....

    i've got a div (#contentbackground) that contains nested divs(#itembox), each of which has an image on the left and text on the right. the images are 75px tall, and the text can be whatever length. i have a background image in these 'itemboxes' as well. these two bits are spec'd as follows:

    #contentbackground{
    width: 400px;
    height: 100%;
    display: block;
    position: relative;
    margin-top: 40px;
    margin-right: auto;
    margin-left: auto;
    background-image: url(assets/k.jpg);
    }

    #itembox{
    display: block;
    margin-top: 15px;
    margin-bottom: 15px;
    background-image: url(assets/k.jpg);
    }

    --- then, i have applied this:

    .floatleft {
    float: left;
    padding-right: 10px;
    display: inline;
    }

    to the images in the 'itemboxes' and am wondering if there's not something i can put into this bit of code that would make the 75px image determine the minimum height of its parent 'itembox'.

    this stuff seems like it should be pretty basic and IE makes me want to use tables again!! argh! thanks for the help.

  • #2
    New Coder
    Join Date
    Dec 2004
    Location
    derby (uk)
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts
    this had had me pulling hair out (not mine fortunatly) while the css looks ok.. try changing the '%' specification in the height to a 'px' absolute. Its not ideal but it does appear to work, ala 'height: 100px' works while 'height: 100%' appears not to. No idea why.

    The idea to get things to scale correctly like a 'div' box is brilliant, or will be when it works right.

    Till then try the abosulte pixel specs and see if that works. at least it will show you if thats the problem or it is elsewhere.
    --
    Claire Rand
    A spanner in the steam turbines of life

  • #3
    Regular Coder
    Join Date
    Jul 2004
    Location
    mile high city
    Posts
    482
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Computer, kill Flanders... Did I hear my name? My ears are burning...
    Good start. Now finish the job.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •