使用 CSS 对背景位置属性进行动画处理
使用 @keyframes 对背景位置进行动画处理。若要使用 CSS 对 background-position 属性实施动画处理,你可以尝试运行以下代码
实例
<!DOCTYPE html>
<html>
<head>
<style>
div {
width: 500px;
height: 400px;
background: yellow;
background-image: url('https://tutorialspoint.com/latest/microservice_architecture.png');
animation: myanim 3s infinite;
background-position: bottom left;
}
@keyframes myanim {
20% {
background-color: maroon;
background-position: bottom right;
}
}
</style>
</head>
<body>
<div></div>
</body>
</html>
广告
数据结构
网络
关系型数据库管理系统
操作系统
Java
iOS
HTML
CSS
Android
Python
C 编程
C++
C#
MongoDB
MySQL
Javascript
PHP