CSS Fixed Header

I am using the following code to lock the header. This works great except in IE6. How can I modify this so that content scrolls underneath the header in IE6?
<style type="text/css">
 body{
  margin:0;
  padding:85px 0 0 0;
 }
 div#lockheader{
  position:absolute;
  top:0;
  left:0;
  width:100%;
  height:50px;
  background:#fff;
 }
 @media screen{
  body>div#lockheader{
   position: fixed;
  }
 }
 * html body{
  overflow:hidden;
 }
 
 #lockcontent {
 background: #fff url(images/background.gif) repeat-x !important;
 } 
  
 * html div#lockcontent{
  height:100%;
  overflow:auto;  
 }
 
</style>

Open in new window

LVL 3
yourbudweiserAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Chad HaneyChief Technology OfficerCommented:
This works in IE6 for me.  Copied the exact code I have working.
<html>
<head>
<style type="text/css">
 body{
  margin:0;
  padding:85px 0 0 0;
 }
 div#lockheader{
  position:absolute;
  top:0;
  left:0;
  width:100%;
  height:50px;
  background:#fff;
 }
 @media screen{
  body>div#lockheader{
   position: fixed;
  }
 }
 * html body{
  overflow:hidden;
 }
 
 #lockcontent {
 background: #fff url(images/background.gif) repeat-x !important;
 } 
  
 * html div#lockcontent{
  height:100%;
  overflow:auto;  
 }
 
</style>
</head>
<body>
<div id="lockheader">
test
</div>
<div id="lockcontent">
words</br>
words</br>
words</br>
words</br>
words</br>
words</br>
words</br>
words</br>
words</br>
words</br>
words</br>
words</br>
words</br>
words</br>
words</br>
words</br>
words</br>
words</br>
words</br>
words</br>
words</br>
words</br>
words</br>
words</br>
words</br>
words</br>
words</br>
words</br>
words</br>
words</br>
words</br>
words</br>
words</br>
words</br>
words</br>
words</br>
words</br>
words</br>
words</br>
words</br>
words</br>
words</br>
words</br>
words</br>
words</br>
words</br>
words</br>
words</br>
words</br>
words</br>
words</br>
words</br>
words</br>
words</br>
words</br>
words</br>
words</br>
words</br>
words</br>
words</br>
words</br>
words</br>
words</br>
words</br>
</div>
</body>
</html>

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
yourbudweiserAuthor Commented:
this is the same code I have but you added the html?
0
Chad HaneyChief Technology OfficerCommented:
Added the html?  you mean the  multiple "words</br>" I used to test the scrolling?
0
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

yourbudweiserAuthor Commented:
yes... you didn't change any of the css that i can see... wonder why that wasn't working on my page.
0
Chad HaneyChief Technology OfficerCommented:
not sure.  was your lock content within the lock header or separate?

IE6-scroll.jpg
0
yourbudweiserAuthor Commented:
I have since moved on but thanks for you efforts!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
CSS

From novice to tech pro — start learning today.