在CSS最大宽度上执行动画
要使用CSS在max-width属性上实现动画,您可以尝试运行以下代码
示例
<!DOCTYPE html>
<html>
<head>
<style>
div {
overflow: auto;
background-color: blue;
color: white;
border: 1px solid black;
animation: myanim 3s;
}
@keyframes myanim {
30% {
max-width: 250px;
}
}
</style>
</head>
<body>
<h1>Example of max-width</h1>
<div>
<p>This is demo text. This is demo text. This is demo text.
This is demo text. This is demo text. This is demo text.
This is demo text. This is demo text. This is demo text.
This is demo text. This is demo text. This is demo text.
This is demo text. This is demo text. This is demo text.
This is demo text. This is demo text. This is demo text.
This is demo text. This is demo text. This is demo text.
</p>
</div>
</body>
</html>热门推荐
1 入学校简短祝福语
10 妈妈生日祝福语简短温暖
11 致姐姐生日祝福语简短
12 叔叔生日祝福语简短搞笑
13 朋友领证祝福语长文简短
14 圣诞简短祝福语给父母
15 对美好前程祝福语简短
16 送菜的祝福语简短霸气
17 给儿子祝福语简短霸气
18 新婚红包祝福语简短男