一、背景总结
- background-color:背景颜色
- background-image:背景图片
- background-repeat:是否平铺
- background-position:背景位置
- background- attachment:背景固定 还是滚
二、导航案例
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
.nav {
display: inline-block;
width: 100px;
height: 70px;
text-align: center;
line-height: 70px;
color: #fff;
}
.nav:hover {
background: url(./index.webp) 0px -13px no-repeat;
color: orange;
}
.two {
background-color: rgba(8, 8, 8, 0.5);
}
</style>
</head>
<body>
<div class="two">
<div class="nav">游戏资料</div>
<div class="nav">内容中心</div>
<div class="nav">赛事中心</div>
<div class="nav">百态王者</div>
<div class="nav">社区互动</div>
<div class="nav">玩家支持</div>
<div class="nav">IP新游</div>
</div>
</body>
</html>