Position a Div “Fixed” Vertically and “Absolute” Horizontally within a “Position:Relative” Container Div

后端 未结 3 1669
梦毁少年i
梦毁少年i 2020-12-19 00:42

I\'m looking for a way I can create a div which will be fixed on the page vertically, so if the user scrolls down, the div stays at the same place on the page. But have it p

3条回答
  •  一个人的身影
    2020-12-19 01:45

    Here's my solution (tested in Opera and Firefox): http://jsfiddle.net/cCH2Z/2 The trick is to specify right: 0px;, this will position the box 0px from the right border of the window.

提交回复
热议问题