Welcome to WebmasterWorld Guest from 54.145.104.199

Forum Moderators: not2easy

Message Too Old, No Replies

Any help in keeping height of Div 100%

     
1:41 pm on Sep 30, 2008 (gmt 0)

5+ Year Member



i have designed css based layout ,but there is one problem #MnuDiv and #ContDiv doesn't take the 100% height even though i have specify it in css
what i am actually looking for is what ever the height of content div..menu div height should be the same

i paste my css down here

#maincontainer{background:#FCFCFC;width:98%;height:100%;padding:0;margin:0 ;position:relative;}

#head{height:80px;background:#FFFFFF;}
#logo {padding:2px;float:left;height:100%;width:25%;}
#anim{padding:2px;float:left;width:65%;height:100%;overflow:hidden;}

#msdiv{width:100%;height:100%;padding:2px;-moz-border-radius-bottomleft:5px;}

#MnuDiv{padding:2px;float:left;height:100%;width:230px;background-color:#f8f9f6;overflow:hidden;}

#ContDiv{padding:2px;float:left;width:78%;height:100%;}
.ContHeading {background:#F7F7F7;color:#004a95;padding:7px 7px 5px;}
.ContDet{margin:5px 0 0;padding:2px;height:100%;overflow:visible;}

#footer{clear:left;width:100%;background:#cccccc;}

can u please suggest me where i should do the changes......any suggestion is highly appreciated

3:36 pm on Sep 30, 2008 (gmt 0)

WebmasterWorld Senior Member swa66 is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Welcome to webmasterworld.

height specified in percentage means relative to the containing block, but there are a few gotchas:

[w3.org...]
states:

The percentage is calculated with respect to the height of the generated box's containing block. If the height of the containing block is not specified explicitly (i.e., it depends on content height), and this element is not absolutely positioned, the value computes to 'auto'.

This goes back all the way to the root element (which does have a height of the viewport).

So unless you explicitly set the height yourself somehow, it's not going to play along with you I'm afraid.

To make columns look the same: it's possible fake backgrounds can help: vertically repeat an image as background on the parent. If needed stretch the parent with a clear (as I see both your columns are floated (which in itself isn't necessary)

Since you use the mozilla proprietary border radius:

  • webkit also has a similar one named "-webkit-border-bottom-left-radius", should be good for safari and chrome a.o.
  • CSS3's is here: [w3.org...]
5:00 am on Oct 1, 2008 (gmt 0)

5+ Year Member



hey dear swa66 thanx for your advice
well i browse through both of the links which u gave its really come handy
i liked your idea of putting image at background..it really helped
 

Featured Threads

Hot Threads This Week

Hot Threads This Month