-
Notifications
You must be signed in to change notification settings - Fork 14
/
no0or100.html
executable file
·42 lines (42 loc) · 1.08 KB
/
no0or100.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="utf-8">
<title>Animation without to or from keyframe selectors</title>
<link href="../styles/style-edit.css" rel="stylesheet">
<style>
div{
padding: 20px;
margin: 20px;
color: white;
font-family: sans-serif;
border: 1px black solid;
}
</style>
</head>
<body>
<style contenteditable id="editme">div {--bgcolor: red;
animation: change_bgcolor infinite 10s alternate;
background-color: var(--bgcolor);
}
@keyframes change_bgcolor {
45% {
background-color: green;
border-width: 10px;
}
55% {
background-color: blue;
border-width: 20px;
}
}
</style>
<div>This animation behaves as if was written:
<pre> @keyframes change_bgcolor {
0% { background-color: var(--bgcolor); border-width: 1px;}
45% { background-color: green; border-width: 10px; }
55% { background-color: blue; border-width: 20px;}
100% { background-color: var(--bgcolor); border-width: 1px;}
}</pre></div>
<p>Change the "red" to "yellow" in the CSS code block for the <em>div</em></p>
</body>
</html>