ID非公開
ID非公開さん
2020/11/27 19:05
1回答
下記リンクにサンプルを作りましたが、疑似要素とcssのcalcを組み合わせた場合に、中のリンクが機能しなくなるのですが、
下記リンクにサンプルを作りましたが、疑似要素とcssのcalcを組み合わせた場合に、中のリンクが機能しなくなるのですが、 解決法があればご教授頂ければ幸いです。 何卒宜しくお願い致します。 https://jsfiddle.net/1r6ufm0o/ ------------------------------------------------------ 【HTML】 <div class="bdr01"> <p><a href="#">リンク</a></p> </div> ------------------------------------------------------ 【CSS】 a { text-decoration: none; } *, *:before, *:after { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; -o-box-sizing: border-box; -ms-box-sizing: border-box; box-sizing: border-box; } .bdr01{ text-align: center; display: block; padding: 10px 20px; margin: 0; border: solid 3px #e0ab0a; position: relative; } .bdr01:after{ content: ""; border: solid 3px #32984e; position: absolute; top: 0; left: 0; width: calc(100%); height: calc(100%); }
ベストアンサー
.bdr01:after { }に下記を追加します。 z-index: -1; 参考サイト https://bibabosi-rizumu.com/button-absolute/
質問者からのお礼コメント
ありがとうございます!大変助かりました!
お礼日時:2020/11/27 21:46