div {
width: 100px;
height: 100px;
background: red;
transition: width 2s;
transition-timing-function:linear;
}
div:hover { width: 300px; }
<div></div>
答案 0 :(得分:0)
试试这个:
div {
width: 100px;
height: 100px;
background: red;
margin-left: auto;
margin-right: auto;
transition: width 2s;
transition-timing-function: linear;
}
div:hover {
width: 300px;
}
<div></div>