---
id: 587d78a7367417b2b2512ae0
title: Use CSS Animation to Change the Hover State of a Button
challengeType: 0
videoUrl: ''
localeTitle: استخدم CSS Animation لتغيير حالة Hover لزر
---
## Description
يمكنك استخدام @keyframes
لتغيير لون زر في حالة التمرير الخاصة به. في ما يلي مثال على تغيير عرض الصورة على مؤشر الماوس: <نمط>
img: hover {
اسم الرسوم المتحركة: العرض ؛
مدة الحركة: 500 مللي ثانية ؛
}
keyframes width {
100٪ {
العرض: 40 بكسل
}
}
</ النمط>
<img src = "https://bit.ly/smallgooglelogo" alt = "شعار Google" />
## Instructions
لاحظ أن ms
يقف للمللي ثانية ، حيث 1000ms تساوي 1s. استخدم @keyframes
لتغيير background-color
عنصر button
بحيث يصبح #4791d0
عندما #4791d0
المستخدم فوقها. يجب أن يكون لقاعدة @keyframes
إدخال 100%
.
## Tests
```yml
tests:
- text: يجب أن تستخدم قاعدةkeyframes لون خلفية animation-name
.
testString: 'assert(code.match(/@keyframes\s+?background-color\s*?{/g), "The @keyframes rule should use the animation-name
background-color.");'
- text: 'يجب أن تكون هناك قاعدة واحدة تحت @keyframes
تغير background-color
إلى #4791d0
بنسبة 100٪.'
testString: 'assert(code.match(/100%\s*?{\s*?background-color:\s*?#4791d0;\s*?}/gi), "There should be one rule under @keyframes
that changes the background-color
to #4791d0
at 100%.");'
```
## Challenge Seed
## Solution
```js
// solution required
```