Skip to content

Commit 3c08c88

Browse files
committed
updating transitions example
1 parent 041fdf1 commit 3c08c88

File tree

1 file changed

+30
-12
lines changed

1 file changed

+30
-12
lines changed

howto/transition-button.html

Lines changed: 30 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,30 +7,42 @@
77
<link rel="stylesheet" href="styles.css">
88
<style>
99
.wrapper {
10-
height: 150px;
11-
display: flex;
12-
align-items: center;
13-
justify-content: center;
10+
height: 150px;
11+
display: flex;
12+
align-items: center;
13+
justify-content: center;
1414
}
1515

1616
button {
17-
padding: 5px 10px;
18-
border: 0;
19-
border-radius: 5px;
20-
font-weight: bold;
21-
font-size: 140%;
17+
padding: 5px 10px;
18+
border: 0;
19+
border-radius: 5px;
20+
font-weight: bold;
21+
font-size: 140%;
22+
cursor: pointer;
23+
}
24+
25+
.fade:focus,
26+
.fade:active {
27+
background-color: black;
2228
}
2329
</style>
2430

2531
<style class="editable">
2632
.fade {
2733
background-color: #DB1F48;
2834
color: #fff;
29-
transition: background-color 2s;
35+
transition: background-color 1s;
3036
}
3137

3238
.fade:hover {
33-
background-color: #004369;
39+
background-color: #004369;
40+
}
41+
42+
.fade:focus,
43+
.fade:active {
44+
background-color: black;
45+
transition: none;
3446
}
3547
</style>
3648
</head>
@@ -46,12 +58,18 @@
4658
.fade {
4759
background-color: #DB1F48;
4860
color: #fff;
49-
transition: background-color 2s;
61+
transition: background-color 1s;
5062
}
5163

5264
.fade:hover {
5365
background-color: #004369;
5466
}
67+
68+
.fade:focus,
69+
.fade:active {
70+
background-color: black;
71+
transition: none;
72+
}
5573
</textarea>
5674

5775
<textarea class="playable playable-html" style="height: 100px;">

0 commit comments

Comments
 (0)