Reputation: 2147
I have an element with transition: margin-left 0.7s;
on it.
The transition works fine, but it also animates on zoom. Is there any way to stop this?
Examples using width
instead of margin-left
:
JSFiddle: https://jsfiddle.net/7py46d3L/
HTML:
<div></div>
CSS:
div {
transition: width 0.7s;
width: 5vw;
height: 10px;
}
div:hover {
width: 10vw
}
Upvotes: 2
Views: 47
Reputation: 6322
Understanding sizing in CSS
There are two types of measurement units:
so in your example if you give width:5[any absolute lengths or in]then > it will work
Upvotes: 1