LoginSignup
9
6

More than 5 years have passed since last update.

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

Last updated at Posted at 2018-09-12

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;
                }
            }
        }
    }

9
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
9
6