html - A container with relative position and overflow hidden doesn't get a height -


i've got following piece of css in want navigation , website absolutely positioned can slide them , forth when menu button pressed(like facebook app example). i've got container overflow: hidden(to hide nav bar , slide in when needed). however; container loses it's autoheight because of absolute positioning within i'm afraid.

how can height set automatically again overflow: hidden without absolute positioning in it.

i've created fiddle in container has height of 500px. want make height scale automatically though. http://jsfiddle.net/rb7ey/

div {     box-sizing: border-box; }   .container {     overflow: hidden;     width: 100%;     max-width: 60em;     padding: 0;     margin: 0 auto;     position: relative;     background: grey;         height: 500px; }      /*css navigation bar can toggled*/      .navigation {         width: 15em;         float: left;         background: blue;         position: absolute;         left: -20px;     }      /*the css actual content*/      .website {         width: 100%;         float: left;         position: absolute;         left: 0px;     }              .container .website .top_bar {                 height: 4em;                 background: pink;                 padding: 1em;                 position: relative;             }                  .container .website .top_bar .menu_button {                     width: 3.2em;                     height: 2.5em;                     background: red;                     border: 0px;                 }       nav.menu {         width: 15em;         position: absolute;         left: 1em;         top: 3em;         background: yellow;     } 

if understand well, enough want scale container automaticly? try using min-height , max-height


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -