Click here to Skip to main content
15,881,967 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
Hello

how do i get my header and footer sidebar and everything to stay fixed on the screen but have only my post scroll on my word-press site

so initially all html elements will be fixed and only the content on the webpage will scroll
my website is blog.claxtracksolutions.com?


I have used position fixed and z-index but that makes my website scroll weird because after I scroll up it doesn't come back down.

Please help me and thank you in advance.!:)
Posted

1 solution

Fixed is the way to go but I am not sure what other things are impacting try the below styles.

CSS
#header
{
position: fixed;
top: 0;
left: 0;
z-index: 1000;
background: rgba(255,255,255,0.95);
width: 100%;
height: 3.5em;
line-height: 3.5em;
text-align: center;
font-family: 'Open Sans Condensed', sans-serif;
font-weight: 700;
text-transform: uppercase;
}

#footer span
{
   position:fixed;
   bottom:0;
   width:98%;
   float: left;
   height:14px;   /* Height of the footer */
   background:#0c609b;
   text-align: center;
   font-size: small;
   color: white;
   clear: both;
   

}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900