6
Help us understand the problem. What are the problem?

More than 3 years have passed since last update.

posted at

updated at

::aftarなどの擬似要素にhover:を付ける

HTML

test.php
<div class="test_box">
  <a href="#">test</a>
</div>

SCSS

_test.scss
    .test_box {
        border-top: 1px solid #616161;

        a {
            display: block;
            position: relative;
            padding: 10px 30px 10px 10px;
            border-radius: 0 0 5px 5px;
            color: #fff;
            font-family: Shin Go Bold;
            font-size: 0.75rem;
            line-height: (16/12);
            text-align: right;

            &::after {
                content: "";
                position: absolute;
                top: 0;
                right: 16px;
                bottom: 0;
                width: 7px;
                height: 7px;
                margin: auto;
                transform: rotate(-225deg);
                border-top: 2px solid #fff;
                border-left: 2px solid #fff;
            }

            &:hover {
                color: #fff100;

                &::after {
                    border-color: #fff100;
                }
            }
        }
    }

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Sign upLogin
6
Help us understand the problem. What are the problem?