css - Make div stretch to length of it's content and beyond if parent div is longer? -


i want make div (my sidebar) stretch bottom of page. know need add "height: 100%;" in order that.

but when add height: 100%;, pages have less content sidebar cuts sidebar's height , can't see sidebar content.

this index page . looks way want to.

this sample page . notice sidebar has been cut.

css:

#menu-container {     background-image: url('floral.png');     width: 300px;     display: inline-block;     vertical-align: top;     height: 100%;     overflow: hidden;      position: absolute; }  #menu {     background-image: url('menubg.png');     width: 220px;     margin: 0;     padding-top: 50px;     padding-left: 30px;     padding-right: 20px;     color: #e8e8e8;     height: 100%;  }  #content {     padding: 0px 0px 30px 325px;     width: 1000px;     display: inline-block;     vertical-align: top; } 

thanks in advance!

* @ritabrata gautam *

the changed css fixed second problem i'm cut off sidebar on shorter pages: see here: http://www.tarawilder.com/staging/?page_id=19

i'm leaving house now, i'll able respond later tonight. again help!

#container { display: inline-block; height: 100%; position: absolute; width: 900px; } 

try this..it give result want..though there many other mistakes in html markup

some other areas need careful...

your container's width 900px..which contains side menu , large text...combined width of side menu , large text far greater 900px width of container..as not using overflow:hidden; cant see effect...why dont apply overflow:auto; width:100% or that

better css::

#container {  height: 100%;  width: 100%;  overflow: auto;  position: absolute; } 

according new problem :: body height must more 100% now..thats why after 100% height side menu becomes invisible

changed css ::

#container {  height: auto;  overflow: hidden;  position: absolute;  width: 100%; } 

your third problem :: strange...you using width:100% cantainer..and container contains side menu , large text...and side menu has width of 300px , having width of 1000px large text..so naturally overflowed part ot text gets invisible; , remove position:absolute; container css

 #container {   height: auto;   overflow: hidden;   width: 100%;  }  #content {   padding: 0px 0px 30px 325px;  vertical-align: top;  } 

note:: don't delete edited part of question..you have deleted 2nd edit made question earlier...it create difficulties future users relate answer question


Comments

Popular posts from this blog

assembly - 8086 TASM: Illegal Indexing Mode -

Java, LWJGL, OpenGL 1.1, decoding BufferedImage to Bytebuffer and binding to OpenGL across classes -

javascript - addthis share facebook and google+ url -