本次任务是背景图片+ul序列标签所制作的电商悬浮框。
特别注意的一点是导入背景图的大小要和盒子的大小一致,详细看如下代码:
代码块
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>精美电商悬浮框</title>
<style>
body{
margin: 0 auto;
padding: 0;
}
.box1{
width: 171px;
height: 489px;
background: url("img/bg.jpg") no-repeat center center;
}
ul{
width: 100%;
height: 100%;
list-style: none;
padding-top: 195px;
padding-left: 45px;
}
li{
width: 50%;
height: auto;
font-family: "微软雅黑";
color: #fff;
text-align: center;
line-height: 40px;
border-bottom:#fff 1px dashed;
}
</style>
</head>
<body>
<div class="box1">
<ul>
<li>服装鞋帽</li>
<li>数码家电</li>
<li>运动户外</li>
<li>孕婴用品</li>
<li>厨卫家居</li>
</ul>
</div>
</body>
</html>