I want to use a transition + transform when someone hovers in my banner. Here the example:
#banner:hover {
transition: all 300ms;
transform: scale(1.01, 1.01); }
But when I quit the mouse over the banner, it suddenly transforms again to scale(1,1) but with no transition. I've tried with:not(hover) but what happens is that when I refresh the page, the banner makes a transition. Idk how to fix this. All I want is a transition when I hover on it and a transition when I put my mouse away from the banner, anything else.
I see some doubts so I'm going to clarify them. I ONLY want a transition when I hover the banner and when I quit the mover hover, a transition returning to his first scale. I have this code in #banner and in #banner:hover :
#banner {
transform: scale(1, 1); }
#banner:hover {
transition: all 300ms;
transform: scale(1.01, 1.01);}
The problem here is, if I put the transition: all 300ms; on my #banner, when I refresh the website it makes a transition.
Solved: adding transition: 300ms; in the #banner and not #banner:hover.