<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<style>
.box{
position: relative;
float: left;
width: 200px;
height: 50px;
background-color: gray;
margin: auto 10px;
text-align: center;
line-height: 50px;
}
.box:hover::after{
transform: scale(1,1);
transform-origin: right bottom;
}
.box::after{
content: "";
display: block;
width: 200px;
height: 5px;
position: absolute;
bottom: 0px;
background-color: red;
transform: scale(0,1);
transform-origin: left bottom;
transition: transform 1s;
}
</style>
<body>
<div class="box">Hover</div>
<div class="box">Hover</div>
<div class="box">Hover</div>
<div class="box">Hover</div>
</body>
</html>