你可以很容易地这样做:http ://codepen.io/pageaffairs/pen/Gtzqu
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<style media="all">
nav {
position: fixed;
top: 0px;
left: 50%;
width: 100px;
margin-left: -250px;
}
.centered300 {
width: 300px;
margin-left: auto;
margin-right: auto;
position: relative;
}
.item {
padding: 10px;
background: rgba(0,0,0,0.1);
margin-bottom: 5px;
}
</style>
</head>
<body>
<nav>
<p>Link 1</p>
<p>Link 2</p>
<p>Link 3</p>
</nav>
<section class="centered300">
<div class="item">
<p>Hello I'm a bunch of page content. I say random stuff blah blah blah.</p>
</div>
<div class="item">
<p>Hello I'm a bunch of page content. I say random stuff blah blah blah.</p>
</div>
<div class="item">
<p>Hello I'm a bunch of page content. I say random stuff blah blah blah.</p>
</div>
<div class="item">
<p>Hello I'm a bunch of page content. I say random stuff blah blah blah.</p>
</div>
<div class="item">
<p>Hello I'm a bunch of page content. I say random stuff blah blah blah.</p>
</div>
<div class="item">
<p>Hello I'm a bunch of page content. I say random stuff blah blah blah.</p>
</div>
<div class="item">
<p>Hello I'm a bunch of page content. I say random stuff blah blah blah.</p>
</div>
<div class="item">
<p>Hello I'm a bunch of page content. I say random stuff blah blah blah.</p>
</div>
</section>
</body>
</html>