#bottom isn't showing up because it's full of floated elements so it collapses on itself. Applying clearfix to bottom fixes your problem, but since you have head.gif it's some sort of checkered background.
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.
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:
As I mentioned, it's not supported in older browsers, so if he's looking to design with IE7 or lower in mind, it's not the best solution..with THAT being said, your inline-block solution is no better, as inline-block was first supported in IE8 as well, in addition, the pseudo-element :after wasn't supported until IE8 either
Background image of my div
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:
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?
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 -_-
How about an overflow:hidden; on the #footer div
Thanks jozsef it worked :D Thanks a ton man. I was messing with this code since yesterday :D
#bottomisn't showing up because it's full of floated elements so it collapses on itself. Applying clearfix to bottom fixes your problem, but since you havehead.gifit's some sort of checkered background.That will work as a clearfix for modern browsers, not for older browsers. For other clearfix solutions, see here.
overflow: hidden; will work, but may cause some unintended consequences later on.
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
amd
There are other option but that would be the simplest way.
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.
OK ChrisP i'll use it too, Since i need this website for long :) Thanks for your valuable suggestion.
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:
@jozsef, you're correct, but it's supported down to IE8, http://caniuse.com/#feat=css-table
As I mentioned, it's not supported in older browsers, so if he's looking to design with IE7 or lower in mind, it's not the best solution..with THAT being said, your inline-block solution is no better, as inline-block was first supported in IE8 as well, in addition, the pseudo-element
:afterwasn't supported until IE8 eitherhttp://caniuse.com/#feat=inline-block