...

View Full Version : set HEADER to stay in place and CONTENT to scroll?



jarv
01-23-2012, 04:11 PM
Do I need to use FRAMESET? I would like to keep my header always at the top and everything else underneath to scroll up, can this be done in CSS?

http://www.jbiddulph.com/aandh/index.php

thanks

Excavator
01-23-2012, 05:33 PM
Good morning jarv,
It's not hard to do with positioning, no need for a frameset. Look at this site that explains a lot about positioning (http://www.barelyfitz.com/screencast/html-training/css/positioning/).

Try making these changes to your CSS -

#header{
/*position:relative; */
z-index:2;
position: fixed;
top: 0;
}

#content {
/*clear: both; */
background-image: url(../images/bgwhite.png);
background-repeat: repeat-y;
clear: both;
margin: 140px auto 0;
overflow: hidden;
padding: 17px 40px 12px;
position: relative;
width: 950px;
}

jarv
01-24-2012, 12:32 PM
thanks but now it's positioned over to the left of the page and I have lost the full width background?!

coothead
01-24-2012, 02:00 PM
Hi there,

you also need to add - width:100%; to the #header attributes. ;)

coothead

jarv
01-24-2012, 05:03 PM
thanks

coothead
01-24-2012, 06:06 PM
No problem, you're welcome. ;)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum