css - Combination of header - main_wrapper makes page scrollabe for header-height -


i'm making webpage fixed footer. if there lot of content, there must scroll bar. if there 1 line of input in content-part, there no need scroll. way page made now, gives me scroll bar time! scrolls far header disappears screen. --> header 150px high , can scroll 150px. don't want this. wrong html or css?

this html:

<body> <div id="header">     <h1>the <span>ultimate</span><br />dvd collection</h1> </div> <div id="main_wrapper">     <div id="main">         <div id="choose">#abcdefghijklmnopqrstuvwxyz</div>         <div id="content">main content comes here.</div>     </div> </div> <div id="footer">     <p>my name <span>admin log-in</span>     </p> </div> 

here's css:

html, body {     height: 100%;     margin: 0 auto; } body {     font-family: helvetica, arial, sans-serif;     color: #666;     font-size: 12px;     line-height: 1.5em;     /*position: relative;*/ } #header {     height: 150px;     background: linear-gradient(left, #2a2620, #a35e47);     border-top: 10px solid #f6e6c5;     border-bottom: 10px solid #f6e6c5;     background-color: #a35e47; } h1 {     width: 960px;     margin: 35px auto 0;     font-family:'luckiest guy', cursive;     font-size: 3.5em;     line-height: 1em;     text-transform: uppercase;     font-weight: 400;     color: #a35e47;     text-shadow: 0px 0px 2px #f6e6c5, 4px 4px 8px #000000; } h1 span {     font-family:'aclonica', verdana, sans-serif;     font-size: 1.75em; } #main_wrapper {     height: 100%;     min-height: 100%;     background-image: url('http://4.bp.blogspot.com/-jpxp0hgum7o/t0oil_iupqi/aaaaaaaaams/xu5zntquloe/s1600/img_0665+hollywood+star.jpg');     background-repeat: no-repeat;     background-position: 50% 60%;     background-color: #5a646d; } #main {     width: 960px;     height: 100%;     margin: 0 auto;     background-color: #fff;     opacity: .75;     /*overflow: auto;*/ } #choose {     margin-left: 20px;     font-family: georgia, serif;     font-style: italic;     font-weight: bold;     text-transform: uppercase;     font-size: 1.5em;     line-height: 2em;     letter-spacing: 20px;     overflow: hidden; } #content {     margin-left: 20px;     margin-right: 20px; } #footer {     height: 40px;     width: 100%;     border-top: 10px solid #f6e6c5;     background: linear-gradient(left, #2a2620, #a35e47);     position: fixed;     left: 0;     bottom: 0; } 

you can see code in jsfiddle.

what doing wrong? (look @ scroll bar in the picture) in advance!

remove height:100% on main-wrapper. height of 100% means 100% of available space inside parent (the header , main-wrapper has same parent). main-wrapper not aware of headers height. result 100% + 150px.


Comments

Popular posts from this blog

Delphi XE2 Indy10 udp client-server interchange using SendBuffer-ReceiveBuffer -

Qt ActiveX WMI QAxBase::dynamicCallHelper: ItemIndex(int): No such property in -

Enable autocomplete or intellisense in Atom editor for PHP -