1. 超大图片居中显示
1.1 放大缩小都居中显示
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
body {
overflow-x: hidden;
}
.top-banner .banner-list a {
display: block;
width: 100%;
height: 500px;
background-position: 50%;
}
*{
margin: 0;
padding: 0;
}
</style>
</head>
<body>
<div class="top-banner">
<div class="banner-list" >
<a href="#" style="background-image: url(xx.jpg);"></a>
</div>
</div>
</body>
</html>
更多专业前端知识,请上 【猿2048】www.mk2048.com