Skip to content

Commit be899ce

Browse files
authored
Update animate-images-with-keyframes-using-css.mdx
1 parent c01e04a commit be899ce

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

projects/animate-images-with-keyframes-using-css/animate-images-with-keyframes-using-css.mdx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Images are quintessential to any website. It's the sparkle and it's the pizzaz!
4040

4141
You may recall using this line to add an image to your HTML file.
4242

43-
```html
43+
```
4444
<img src="your-path.png" alt="red chocolate chip cookie" />
4545
```
4646

@@ -78,10 +78,10 @@ CSS animations have "steps" in them (also known as keyframes) to signify each mo
7878

7979
For example,
8080

81-
```html
81+
```
8282
<div className="box"></div>
8383
```
84-
```css
84+
```
8585
@keyframes colorChange {
8686
0% { background-color: red; }
8787
50% { background-color: yellow; }
@@ -104,7 +104,7 @@ So at 0% of the animation, the color is red, at 50% it's yellow, and at 100% or
104104

105105
Let's also take a look at this line of code:
106106

107-
```css
107+
```
108108
animation: colorChange 2s infinite;
109109
```
110110

@@ -129,7 +129,7 @@ Some common ones you'll see:
129129

130130
These can differ and are added right in the `animation:` of your CSS.
131131

132-
```css
132+
```
133133
.tinker_bell {
134134
animation: bounce 1s linear infinite;
135135
}
@@ -146,13 +146,13 @@ Think of the last time you saw a spinning loader:
146146

147147
This can be recreated with a spin animation like so:
148148

149-
```html
149+
```
150150
<div className="sensei">
151151
<img src="sensei.png" alt="club penguin gray sensei penguin" />
152152
</div>
153153
```
154154

155-
```css
155+
```
156156
/* spinning animation */
157157
@keyframes spin {
158158
from {
@@ -188,12 +188,12 @@ Imagine you're playing a video game and you're choosing which character to play
188188

189189
This is a hovering animation that we can create with keyframes!
190190

191-
```html
191+
```
192192
<div className="sensei">
193193
<img src="sensei.png" alt="club penguin gray sensei penguin" />
194194
</div>
195195
```
196-
```css
196+
```
197197
/* bouncing animation (floating) */
198198
@keyframes bounce {
199199
0%, 100% {

0 commit comments

Comments
 (0)