<div></div>
body {
}
div {
position: relative;
left: 50%;
width: 100px;
height: 100px;
background: green;
transition: width 1s;
transform: translateX(-50%);
}
div:hover {
width: 300px;
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.