css部分
*{
margin: 0;
padding: 0;
}
body{
height: 1000px;
}
dl{
width: 70px;
height: 350px;
/* background-color: antiquewhite; */
position: fixed;
right: 130px;
top: 150px;
}
dd{
width: 70px;
height: 70px;
border-bottom: 1px solid white;
background-color: cornflowerblue;
text-align: center;
color: white;
font-size: 14px;
padding-top: 44px;
box-sizing: border-box;
background-repeat: no-repeat;
background-size: 24px 24px;
background-position: center 10px;
cursor: pointer;
}
dd:nth-child(1){
background-image: url(../img/在线咨询.png);
}
dd:nth-child(2){
background-image: url(../img/电话.png);
}
dd:nth-child(3){
background-image: url(../img/微信.png);
}
dd:nth-child(4){
background-image: url(../img/qq.png);
}
dd:nth-child(5){
background-image: url(../img/返回.png);
}
dd:hover{
background-color: red;
}
body部分
<dl>
<dd>在线咨询</dd>
<dd>电话咨询</dd>
<dd>微信</dd>
<dd>QQ咨询</dd>
<dd>返回顶部</dd>
</dl>