Jasmine Lawson
Jasmine Lawson

Reputation: 21

How can I keep my header fixed and still scroll?

I need my header and side bar to stay in place, but I also need to scroll down on the page. I'm using fixed positioning, is there another way to do this?

Upvotes: 2

Views: 13942

Answers (3)

apaul
apaul

Reputation: 16170

It looks like your problem was in your HTML, not your CSS. The <body> tag should encompass all of your content. and don't forget to close your <div></div>. I also moved your body background into the css, try to avoid using inline styles unless you really have to.

<head>
    <Title>About Me!</title>
    <link type="text/css" rel="stylesheet" href="aboutme.css" />
</head>

<body>
    <div id="header"></div>
    <div class="left"></div>
</body>

</html>

Updated Working Example

Upvotes: 0

zey
zey

Reputation: 6105

Add this position:fixed; to your style of parts which you want to stay in fix !

Or

Reference this link !

Upvotes: 3

Buzz LIghtyear
Buzz LIghtyear

Reputation: 490

You can put your content in an iframe and the header and sidebar can be in the top. In this way. You can set the overflow for the iframe element. Probably this could help you out with your requirement

Upvotes: 0

Related Questions