Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    Banned
    Join Date
    Mar 2007
    Posts
    1,523
    Thanks
    116
    Thanked 0 Times in 0 Posts

    Question set HEADER to stay in place and CONTENT to scroll?

    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

  • #2
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,675
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    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.

    Try making these changes to your CSS -
    Code:
    #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; 
    }
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • #3
    Banned
    Join Date
    Mar 2007
    Posts
    1,523
    Thanks
    116
    Thanked 0 Times in 0 Posts
    thanks but now it's positioned over to the left of the page and I have lost the full width background?!

  • #4
    Senior Coder coothead's Avatar
    Join Date
    Jan 2004
    Location
    chertsey, a small town 25 miles south west of london, england.
    Posts
    1,718
    Thanks
    0
    Thanked 240 Times in 235 Posts
    Hi there,

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

    coothead

  • #5
    Banned
    Join Date
    Mar 2007
    Posts
    1,523
    Thanks
    116
    Thanked 0 Times in 0 Posts
    thanks

  • #6
    Senior Coder coothead's Avatar
    Join Date
    Jan 2004
    Location
    chertsey, a small town 25 miles south west of london, england.
    Posts
    1,718
    Thanks
    0
    Thanked 240 Times in 235 Posts
    No problem, you're welcome.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •