<div></div>
body {
}
div {
  position: relative;
  left: 50%;
  width: 100px;
  height: 100px;
  background: green;
  transition: width 1s;
  transform: translateX(-50%);
}

div:hover {
  width: 300px;
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.