1. background-position:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<style>
#container{
height: 1000px;
display: grid;
grid-template-columns: 25% 25% 25% 25%;
grid-template-rows: 25% 25% 25% 25%;
background: url("../imges/twin1.jpg") 50% 50%;
background-repeat: no-repeat;
}
.item {
font-size: 4em;
text-align: center;
border: 1px solid black;
}
</style>
</head>
<body>
<div id="container">
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
</div>
</body>
</html>
诡异
2. background-size:cover:放大图片,完全覆盖
把背景图像扩展至足够大,以使背景图像完全覆盖背景区域。
背景图像的某些部分也许无法显示在背景定位区域中。
3. chorme 浏览器支持
-webkit-text-fill-color: transparent; 文字填充效果
-webkit-background-clip: text;背景切割效果。只保留文字部分的背景。