css - The hover state doesn't work properly on animations -
i have element when user hover on (:hover
), animate left right, element off mouse. :hover
state should normal state, won't happen. wrong?
#test { position: absolute; top: 0; left: 0; width: 100px; height: 100px; background: red; z-index: 20; transition: left 1s linear; } #test:hover { left: 200px; background: green; }
here jsfiddle demo.
within
#test:hover { left: 100px; background: green; }
you tell element go outside width of , transition forces so. if change hover transition left: 100px;
work.
the transition master , hover slave ;)
Comments
Post a Comment