テキスト<a href="#" class="cp_textlink05">リンクテキスト-link text-</a>テキスト
.cp_block {
margin: 5em auto;
text-align: center;
}
.cp_textlink05 {
position: relative;
display: inline-block;
padding: 0.1em 0.3em;
text-decoration: none;
color: #3949AB;
}
.cp_textlink05:after,
.cp_textlink05::before {
position: absolute;
bottom: 0;
content: '';
transition: all 0.3s ease;
}
.cp_textlink05:after {
right: 50%;
left: 50%;
width: 0;
height: 100%;
border-radius: 3px;
background-color: #3949AB;
}
.cp_textlink05::before {
left: 0;
width: 100%;
height: calc(100% - 2px);
border-top: 1px solid #3949AB;
border-bottom: 1px solid #3949AB;
}
.cp_textlink05:hover:after {
bottom: 0;
left: 0;
width: 100%;
height: 100%;
opacity: 0.3;
}
.cp_textlink05:hover::before {
right: 50%;
left: 50%;
width: 0%;
}