开发者

How do you make a menu on the left that stays while the right side scrolls

Like 开发者_如何学JAVAthis one. I thought it was a frame but apparently is not.


in css: position: fixed


You need CSS. Try something like:

#menu {
    left: 20px;
    position: fixed;
    top: 20px;
    width: 200px;
}

Adjust the values as necessary.


This will give you a 200PX tall fixed header and footer, a 200PX wide left navigation, and scrollable content area. here is a demo http://jsbin.com/afesa3/2/edit

<div id="header" style="position:absolute; top:0px; left:0px; height:200px;right:0px;overflow:hidden;background-color:#FF0000">
    Header
</div>
  <div id="leftNav" style="position:absolute; top:200px; bottom:200px; left:0px; width:200px; overflow:hidden; background-color:#00FF00" >Left Nav</div>
  <div id="rightContent" style="position:absolute; top:200px; bottom:200px; left:200px; right:0px; overflow:auto;background-color:#0000FF">Right Content</div>
  <div id="footer" style="position:absolute; bottom:0px; height:200px; left:0px; right:0px; overflow:hidden;background-color:#FF0000"></div> 
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜