小米侧边栏案例
<style>
a{
display: block;
width: 225px;
height: 40px;
background-color: #8e89a3;
font-size: 14px;
color: #ffffff;
text-decoration: none;
/* 首行缩进2em */
text-indent: 2em;
}
a:hover{
background-color: #ff6700;
}
</style>
<body>
<a href="#">手机 电话卡</a>
<a href="#">电视 盒子</a>
<a href="#">笔记本 显示器 平板</a>
<a href="#">家电 插线板</a>
<a href="#">出行 穿戴</a>
</body>
文字垂直居中方法
CSS背景
1.背景图片
background-image: url(图片地址);
2.背景平铺
background-repeat:repeat;
3.背景图片位置
后面是x和y
background-position: 0 0;
背景小图标案例
<style>
h3 {
width: 118px;
height: 41;
background-image: url(test2.png);
background-repeat: no-repeat;
background-position: left;
text-indent: 2sem;
}
h3 a{
font-size: 14px;
text-decoration: none;
font-weight: 400;
color: #000;
}
a:hover{
color: #ffd9c8;
}
</style>
背景大图片案例
body{
background-image: url(wangzherongyaobeijing.jpg);
background-repeat: no-repeat;
background-position:center top;
}
</style>