.box {
background-color: aquamarine;
}
.box:hover {
background-color: gold;
}
transition permet de contrôler
comment cette transition s'effectue
transition est un raccourci (comme border ou background) : elle permet de spécifier plusieurs paramètres
.box {
background-color: aquamarine;
transition: 1s;
}
.box:hover {
background-color: gold;
}
transition: 3s 1s;
transition: 2s ease-out;
transition: 2s linear;
transition: 2s steps(4, end);
transition: background 5s steps(4, end),
width 3s 2s linear,
text-shadow 2s;
:hover, :active, :focus… et les media queries (voir cet article pour des démos)transition change dans l'état
d'arrivée, c'est la nouvelle qui compte.direction {
background: tan;
transition: 3s;
}
.direction:hover {
background: teal;
transition: .5s;
}
auto
n'est pas considérée comme fixée
.piege {
transition: 3s;
margin: auto;
}
.piege:hover {
margin: 0 30%;
}
margin:auto,
car la marge vaut alors 0, ce qui bien « fixé ».
.tourne {
transform: rotate(10deg);
}
Ce texte sera en partie caché.
Ce texte sera en partie caché.
Ce texte sera en partie caché.
Ce texte sera en partie caché.
inline)transformrotate(30deg)scale(2, 0.5)translate(10px, -3em)skewX(10deg), skewY(2.1rad)rotateX(45deg) (voir ce tutoriel)transition: transform 1s,
pas transition: rotate 1s, scale 2s, car ce ne sont pas des propriétés..conteneur .bouge {
transition: 1s;
}
.conteneur:hover .bouge {
transform: translate(60px);
}