본문 바로가기
Web/HTML | CSS|JAVASCRIPT

hover, transition를 이용한 버튼 (HTML, CSS)

by 싸공 2020. 7. 18.
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<style>
    *{
        margin0;
        padding0;
        box-sizingborder-box;
    }
    .container{
        displayflex;
        justify-contentcenter;
        align-itemscenter;
        height100vh;
        background-colorrgb(545242);
    }
    .btn{
        font-size20px;
        font-weightbold;
        letter-spacing4px;
        text-transformuppercase;
        padding30px 35px;
        background-colortransparent;
        colorrgba(68177260.678);
        border3px solid rgb(25500);
        background-imagelinear-gradient(
            120degtransparent 0%transparent 50%rgb(24116023750%
        );
        background-size230%;
        transitionall0.5s;
    }
    .btn:hover{
        background-position100%;
    }
    
</style>
<body>
    <div class="container">
        <button class="btn">Css Hover</button>
    </div>
</body>
</html>