Hi I have two div.
<div id="header">
-- some random html content here --
</div>
<div id="content">
1
2
3
4
5
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
some long content that needs scrolling.
</div>
Here is my css.
#header {
vertical-align:middle;
position:fixed;
top:0ex;
width:800px;
height: 48px;
background-color: #FFFFFF;
z-index: 10;
}
#content {
text-align:center;
margin-left:auto;
margin-right:auto;
width: 800px;
margin-top: 24px;
}
Your question is kind of confusing, but what I got from it was that you needed to scroll part of the page and keep part of it from not scrolling? Using position:fixed instead of position:absolute should keep your div that says "some random html content here" will keep it from scrolling down. To make the header overlap the body, give it a value of background-color:white
. I made a working example here