核心原理:
小盒子left 50% 然后 margin-left 版心宽度一半
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title></title>
<link rel="stylesheet" href="css/reset.css">
<style>
.wrap {
width: 960px;
height: 1200px;
background: #ccc;
margin: 0 auto;
position: relative;
}
.nav {
width: 50px;
height: 100px;
background: #000;
position: fixed;
top: 100px;
left: 50%;
margin-left: 490px;
}
</style>
</head>
<body>
<div class="wrap ">
<div class="nav "></div>
</div>
</body>
</html>