0

I have this side menu that I wanted to be fixed so it will follow the user when the user scrolls. I'm planning to put jumping targets inside it because the contents are very long.

The problem is, I made it fixed and then when I scroll it down, it went pass the footer. I used

top:0;

and it doesn't went up the footer, but it went up the header. What would be the solution?

This is my html.

  <div class="myheader">
  </div>
  <div class="content">
  <div class="left_side">
  </div>
  <div class="right_side">
  </div>
  <div class="footer">
  </div>

This is my css:

.myheader{
float:left;
width:100%;
height:190px;
background: #fff url(img/blackorchid.png) repeat scroll 0 0;
}

.content{
float:left;
background: #fff url(img/linen.png) repeat scroll 0 0;
height:auto;
margin-left:120px;
width:1100px;
}

.left_side{
width:800px;
float:left;
}

.right_side{
width:300px;
height:500px;
background-color:yellow;
float:right;
position:fixed;
top:0;
}

There are contents inside the left_side. That's where the texts are. The division that I want to be fixed is <div class="right_side">.

display-name-is-missing
  • 4,424
  • 5
  • 28
  • 41
nicole101
  • 187
  • 3
  • 20

1 Answers1

0

Not sure I am fully following, but if you want it to be fixed to the foot of the page, then why not set bottom to 0. See here: jsdfiddle. I also set the right to 0 to make it fix to the right of the page.

.right_side{
    width:300px;
    height:500px;
    background-color:yellow;
    position:fixed;
    bottom:0;
    right:0;
}

I added the fill div just to make sure that the page scrolled.

If you want some space from the bottom, then just specify a margin. See this updated fiddle: jsfiddle

acarlon
  • 16,764
  • 7
  • 75
  • 94
  • http://jsfiddle.net/wG3hC/embedded/result/. That's what is happening. What it should be is that it will only scroll inside the content and not get above the header or footer. – nicole101 Feb 02 '14 at 12:21
  • 1
    ok, I think you may need jquery/javascript for that. I have to go out. You may want to look at: http://stackoverflow.com/a/8653109/746754 and http://stackoverflow.com/questions/18053326/how-to-prevent-fixed-button-from-overlapping-footer-area-and-stop-the-button-on – acarlon Feb 02 '14 at 13:02