1h1 { color: #666;display:inline-block; margin:0;text-transform:uppercase; }
2h1:after {
3 display:block;
4 content: '';
5 border-bottom: solid 3px #019fb6;
6 transform: scaleX(0);
7 transition: transform 250ms ease-in-out;
8}
9h1:hover:after { transform: scaleX(1); }
10h1.fromRight:after{ transform-origin:100% 50%; }
11h1.fromLeft:after{ transform-origin: 0% 50%; }
1<h1 class="fromCenter">Expand from center</h1><br/>
2<h1 class="fromRight">Expand from right</h1><br/>
3<h1 class="fromLeft">Expand from left</h1>