<a class="btn" href="#">
gridボタン内のテキストの前後近くにCSSのアイコン
</a>
.btn {
display: grid;
grid-auto-flow: column;
align-items: center;
justify-content: center;
max-width: 500px;
margin-inline: auto;
padding: 10px;
border-radius: 10px;
background: #EFEFEF;
text-decoration: none;
color: inherit;
}
.btn::after,
.btn::before {
position: relative;
top: -1px;
content: "";
width: 7px;
height: 7px;
border-right: 2px solid #000;
border-bottom: 2px solid #000;
}
.btn::before {
margin-left: 5px;
transform: rotate(135deg);
}
.btn::after {
margin-right: 5px;
transform: rotate(-45deg);
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.