Grow Underline
ホバーで中央から左右に広がるアンダーライン。
HTML
<nav class="grow-nav"> <a href="javascript:void(0)">Home</a> <a href="javascript:void(0)">Blog</a> <a href="javascript:void(0)">About</a> </nav>
CSS
.grow-nav {
display: flex;
gap: 1.5rem;
}
.grow-nav a {
position: relative;
font-size: 14px;
font-weight: 500;
color: #666;
text-decoration: none;
padding-bottom: 4px;
transition: color .2s;
}
.grow-nav a::after {
content: '';
position: absolute;
bottom: 0;
left: 50%;
width: 0;
height: 1.5px;
background: #1a1a1a;
transition: all .3s cubic-bezier(.4,0,.2,1);
}
.grow-nav a:hover { color: #1a1a1a; }
.grow-nav a:hover::after {
left: 0;
width: 100%;
}