Jump to content

[SOLVED] nested "Fixed" Div giving me nightmares!


liamloveslearning

Recommended Posts

Hi everybody, I have a wrapper div centered with relative positioning, I then have my header div inside which I would like to be fixed so it doesnt scroll as the rest of my page scrolls, However its positioning itself fixed in relation to the browser window and not the container div, I know its something simple im missing but its causing me nightmares!! heres my code if anybody can figure it out, thanks

 

main page

 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<link href="style.css" rel="stylesheet" type="text/css" />
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>Tint Wizard</title>
    </head>
    <body>

        <div id="wrapper">
    		<div id="header">sdfsdf</div>
		<div id="content">sdfsdfsdfsdf</div>
        </div>

    </body>
</html>

 

and my CSS file

 

body {
margin:0;
}

#wrapper {
width:964px;
margin:0 auto 0 auto;
background-image:url('images/grid.jpg');
padding:0 6px 0 6px;
min-height:600px;
position: relative;
}

#header {
height:250px;
left:15px;
margin-left:0;
overflow:visible;
padding:0 0 0 161px;
position:fixed;
top:7px;
width:141px;
}

#content {
background:transparent url(/images/sitewide/bg-contentArea-white.png) repeat-y scroll 327px top;
padding:209px 15px 31px 337px;
width:624px;
}

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.