Solution détaillée

Exercice 7 : Transitions et animations

Présentation claire au format demandé : numéro de l'exercice, nom, question puis réponse.

Question 1

Créez un bouton avec des transitions au survol

.btn {
  background: #2563eb;
  color: white;
  padding: 12px 20px;
  border-radius: 10px;
  transition: transform 0.3s ease, background 0.3s ease;
}

.btn:hover {
  background: #1d4ed8;
  transform: translateY(-2px);
}
Question 2

Créez un spinner de chargement avec @keyframes

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #dbeafe;
  border-top: 4px solid #2563eb;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}