在 CSS max-width 上執行動畫
若要在 max-width 屬性上使用 CSS 實現動畫,可以嘗試執行以下程式碼
示例
<!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>
廣告
資料結構
網路
關係型資料庫管理系統
作業系統
Java
iOS
HTML
CSS
Android
Python
C 程式設計
C++
C#
MongoDB
MySQL
Javascript
PHP