テキスト<a href="#" class="cp_textlink04">リンクテキスト-link text-</a>テキスト
.cp_block {
margin: 5em auto;
text-align: center;
}
.cp_textlink04 {
position: relative;
padding: 0.1em 0.3em;
transition: all 0.3s ease;
text-decoration: none;
color: #EC407A;
}
.cp_textlink04::before {
position: absolute;
content: '';
left: 0;
bottom:0;
width: 100%;
height: 1%;
transition: all 0.3s ease;
opacity: 0;
background-color: #EC407A;
border-radius: 50px;
}
.cp_textlink04::after {
position: absolute;
bottom: -1px;
left: 0;
width: 100%;
height: 2px;
content: '';
transition: all 0.3s ease;
border-bottom: 2px solid #EC407A;
opacity: 1;
}
.cp_textlink04:hover::before {
height: 100%;
opacity: 0.4;
}
.cp_textlink04:hover::after {
left: 50%;
right: 50%;
width: 0%;
opacity: 0;
}
CSS3などで新たに追加された要素・装飾方法など、日々コードを書いていないと忘れてしまったり、ささっとプロトタイプを作る時などちょっとしたことに時間をかけている暇はない。そんな時に「あ〜、あれストックしときゃよかったなぁ」って困った自分用のストックブログです。カスタマイズなどがしやすいよう、昨今のweb制作に取り入れられる一般的なコードを中心に掲載しています。
@copypet_jp More Info