Starlit Daily

📚 › CSS: style and layout

10. Transitions: smooth changes

ستتم ترجمة هذا المقال تلقائيًا. يُعرض بالإنجليزية حاليًا.

transition makes a change happen gradually instead of instantly. Give the property to animate, and a duration such as 0.3s.

Keep animations short and subtle. Respect users who prefer reduced motion.

عرض المثال

.card {
  transition: transform 0.3s;
}
.card:hover {
  transform: translateY(-4px);
}

✍️ دورك الآن

Give .card a transition of background-color lasting 0.2s.

← العودة إلى الدورة