버튼 hover

by Kim Ara

HTML

<a href="#none">
  <span class="detail_copy">자세히보기<img src="https://fireworksfestival.bulggot.co/en/_resource/img/home/day/tip_arrow_ico.png" alt=""></span>
  <span class="arrow"><img src="https://fireworksfestival.bulggot.co/en/_resource/img/home/day/tip_plus_ico.png" alt=""></span>
</a>

CSS

a {
    position: relative;
    display: block;
    width: 40px;
    height: 40px;
    text-align: center;
    background-color: #6f469f;
    border-radius: 40px;
    margin: 0 auto;
    transition: width 0.3s;
    overflow: hidden;
}

a:hover {
    width: 127px;
}

a > span {
    position: absolute;
    display: block;
}
a .detail_copy {
    width: 127px;
    color: #fff;
    padding: 13px 0;
    line-height: 1;
    vertical-align: top;
    opacity: 0;
    transform: translate(-50%, 0);
    transition: all 0.3s;
    font-size: 13px;
    font-weight: 900;
}
a:hover .detail_copy {
    opacity: 1;
    transform: translate(0, 0);
}
a .detail_copy img {
    margin: 2px 0 0 7px;
}
a .arrow {
    top: 0;
    left: 0;
    width: 40px;
    height: 40px;
    transition: all 0.3s;
}
a:hover .arrow {
    opacity: 0;
}

a .arrow img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}