box-shadowで内側に線を引いたボタン
- RESULT
- HTML
- CSS
- コピー
<p class="msr_btn11"> <a href="#">button01</a> </p>
- コピー
.msr_btn11 a{ width: 230px; padding:15px; color:#ffffff; font-size: 15px; line-height: 120%; text-align: center; text-decoration: none; background: #1B73BA; border: 2px solid #1B73BA; -webkit-box-shadow:0px 0px 0px 1px #ffffff inset; -moz-box-shadow:0px 0px 0px 1px #ffffff inset; box-shadow:0px 0px 0px 1px #ffffff inset; display: block; position:relative; -webkit-transition: 0.3s ease-out; -moz-transition: 0.3s ease-out; -o-transition: 0.3s ease-out; transition: 0.3s ease-out; } .msr_btn11 a::before{ content: ''; width: 6px; height: 6px; border: 0px; margin:0 15px 1px 0; border-top: solid 2px #fff; border-right: solid 2px #fff; -ms-transform: rotate(45deg); -webkit-transform: rotate(45deg); transform: rotate(45deg); position:relative; display:inline-block; -webkit-transition: 0.3s ease-out; -moz-transition: 0.3s ease-out; -o-transition: 0.3s ease-out; transition: 0.3s ease-out; } .msr_btn11 a:hover{ color:#1B73BA; background: #ffffff; } .msr_btn11 a:hover::before{ border-top: solid 2px #1B73BA; border-right: solid 2px #1B73BA; }
検証済みブラウザ
- IE10
- Edge
- FF
- chrome
- Safari