啥都不说上代码:
先看效果:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>居中</title>
<link rel="stylesheet" href="">
<style>
.d1 {
position: fixed;
bottom: 0;
left: 0;
width: 100%;
height: 300px;
background-color: green;
}
.d2 {
position: relative;
width: 1000px;
height: 200px;
bottom: 50px;
margin: 0 auto;
background-color: grey;
}
a {
display: block;
position: absolute;
bottom: 156px;
right: 0px;
width: 50px;
height: 50px;
cursor: pointer;
font: normal 50px Simsun;
color: #fff;
}
</style>
</head>
<body>
<div class="d1">
<div class="d2">
<a>×</a>
</div>
</div>
</body>
</html>