# image {
position: relative//图片的相对位置
animation: falling 1s linear//动画名称为falling,持续时间1s,动画速度变化线性
}
@keyframes falling {
0% { top: 0px} //初始时图片位于顶部
100% { top: 300px} //最终时图片位于300px处
}
background:url(images/loginbackground.png)top no-repeat 0px 10px
等同与
background:url(images/loginbackground.png)top no-repeat
background-position: 0px 10px//水平方向(以左上角为原点,x方向)移动 0像素,垂直方向(y轴方向)即向下以动 10 像素
***注意:0px 不能省略,否则默认为x方向移动的距离。也可以设置为百分比值。
修改后:
首先把a 区块化,然后给定a 一个宽高,比如:a{
display:block
width:100px
height:100px
}
a:hover{
background:图片 no-repeat
}