html - Scrolling of whole page instead of inner div only -
i'm fiddling css again again...
as see, container called map
scrolling independently of rest of container
. how can make whole page scroll when more content placed in content
?
i have tried using overflow attribute, without luck...
edit future references:
body { background:#000000; margin:0; padding:0; overflow:scroll; overflow-x:hidden; } #container{ position: relative; height: 100%; width: 950px;; background: yellow; margin-left:auto; margin-right:auto; overflow:auto; } #map { position:absolute; top:80px; bottom:0; left:0; right:0; background:#fff; overflow:auto; overflow-x:hidden; } #header { height:80px; width:900px; background:#333; margin:0; padding:0; } #header h1 { color:#fff; margin:0; padding:0; } #leftgradient { width:50px; height:80px; float:left; background:#096; background: -webkit-gradient(linear, left top, right top, from(#000000), to(#333333)); } #rightgradient { width:50px; height:80px; float:right; background:#096; background: -webkit-gradient(linear, left top, right top, from(#333333), to(#000000)); } #toppanel { background:#179ae8; width:950px; height:50px; } #leftpanel { background:#179ae8; width:100px; height:250px; float:left; } #content { background:#099; width:850px; margin-left:100px; } <div id="container"> <div id="leftgradient"></div> <div id="rightgradient"></div> <div id="header"> <header> <h1> heading </h1> </header> </div> <div id="map"> <div id="toppanel"> top </div> <div id="leftpanel"> lefty </div> <div id="content"> lots of text!! </div> </div> </div>
if understand correctly, need remove boatload of css declarations:
- on
body
, remove:overflow: hidden
. - on
#container
, remove:height: 100%
,overflow: auto
,position: relative
. - on
#map
, remove:position: absolute
,left: 0
,bottom: 0
,right: 0
,top: 80px
overflow-x: hidden
,overflow-y: auto
.
now can scroll page (tested in firefox only).
removing stuff possibly broke functionality on page. let me know if there anything, , can see finding way add in missing functionality.
to fix issue in comments, add:
html, body { height: 100% }
- on
#container
, addmin-height: 100%
.
now, can see yellow background poking out on #container
. way fix change yellow white, , use background image this:
(save , use it)
on #container
:
background: #fff url(http://i.stack.imgur.com/q1sp1.png) repeat-y
you need remove white background-color
#map
.
Comments
Post a Comment