设置过渡效果的 CSS 属性的名称
要设置过渡效果的 CSS 属性的名称,请使用 CSS transition-property。
在以下示例中,我们已将属性设置为 width,并设置了 duration
示例
<!DOCTYPE html>
<html>
<head>
<style>
div {
width: 150px;
height: 150px;
background: blue;
transition-property: width;
transition-duration: 3s;
}
div:hover {
width: 250px;
}
</style>
</head>
<body>
<h1>Heading One</h1>
<p>Hover over the below box to change its width.</p>
<div></div>
</body>
</html>
广告
数据结构
网络
关系型数据库管理系统
操作系统
Java
iOS
HTML
CSS
Android
Python
C 编程
C++
C#
MongoDB
MySQL
JavaScript
PHP