Layout where header has fixed position, content is in center, and user navigation on centent's right
I have managed to get header at the top, and content at the center. But I did get stuck with placing user-navigation div at the right of the content. I have tried using position:relative
, but what happens it appears below content's div, but on the r开发者_运维问答ight though, and also when I scroll down the view, it appears on top of the header.
So how do I solve this? Thanks!
Updated
This is how it should look visually:
<div id="header">
</div>
<div id="nav">
</div>
<div id="content">
</div>
#header { position:fixed; height:100px; }
#nav { float:right; margin-top:100px; }
#content { overflow:auto; margin-top:100px; }
Should work unless I didn't understand.
Assuming you want the navigation to be inside the content and on top at the bottom right you should do the following. Set the content's position to relative, and then set the navigation's to absolute. Then for the navigation set the position like so -
#nav { position:absolute; bottom:0; right:0; }
Does that work?
精彩评论