Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS background image not in div..

  • This topic is empty.
Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #42047
    iamRDM
    Participant

    Background image of my div

    #bottom{
    background:url(head.gif);
    color: #000000;
    margin-top:10px;
    width:100%;
    }
    is not inside the div..
    here is the link
    http://ideacreativeindia.com/1

    when i apply height to this div
    background is show near that “WHO ARE WE? ” part

    :Help:

    #121245
    Paulie_D
    Member

    I suspect this is because that div either contains divs with no assigned height or are all floated and so it is collapsing.

    How is it supposed to look?

    #121261
    iamRDM
    Participant

    Its looking exact what i need, except footer.
    I wand footer background to be #ffffff

    but it won’t work :(
    when I apply height to footer then its background appears on top -_-

    #121262
    Jozsef K.
    Participant

    How about an overflow:hidden; on the #footer div

    #121264
    iamRDM
    Participant

    Thanks jozsef it worked :D
    Thanks a ton man.
    I was messing with this code since yesterday :D

    #121266
    Paulie_D
    Member

    This because that div either contains divs with no assigned height or are all floated and so it is collapsing.

    You will need to add

    #bottom {
    clear:both;
    height: xxpx;
    }

    amd

    #footer {
    height: xxpx;
    }

    There are other option but that would be the simplest way.

    #121267
    Jozsef K.
    Participant

    Well yes that’s true, overflow:hidden will cut absolutely positioned elements, or select boxes if they hang out of the #footer div. But it there will not be any of these, then I don’t see any problem using overflow:hidden as a clearfix solution.

    Cheers.

    #121268
    iamRDM
    Participant

    OK ChrisP i’ll use it too, Since i need this website for long :)
    Thanks for your valuable suggestion.

    #121269
    Jozsef K.
    Participant

    I would like to add to this, that display:table isn’t the best solution because it’s not supported everywhere.The classic crossbrowser solution would be:



    #footer:after {content:'';clear:both;display:block}
    #footer {display:inline-block}
    #footer {display:block}

Viewing 9 posts - 1 through 9 (of 9 total)
  • The forum ‘CSS’ is closed to new topics and replies.