什么是 CSS 过渡?
cssweb developmentfront end technology更新于 2024/7/18 8:12:17
使用过渡效果,您可以轻松更改属性值。您还可以设置持续时间。
让我们尝试更改元素的高度:
示例
<!DOCTYPE html>
<html>
<head>
<style>
div {
width: 150px;
height: 150px;
background: blue;
transition: width 3s;
}
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/

