设置 CSS 过渡效果完成所需的秒数或毫秒数
cssweb developmentfront end technology更新于 2025/6/21 0:12:17
使用 CSS 中的 transition-duration属性设置 CSS 过渡效果完成所需的秒数或毫秒数 −
示例
<!DOCTYPE html>
<html>
<head>
<style>
div {
width: 150px;
height: 150px;
background: blue;
transition-property: height;
transition-duration: 2s;
}
div:hover {
height: 200px;
}
</style>
</head>
<body>
<h1>Heading One</h1>
<p>Hover over the below box to change its height.</p>
<div></div>
</body>
</html>
相关文章
有用资源
css 参考教程 - 该教程包含有关 css 的更多信息:https://www.cainiaomax.com/css/

