CSS Blue Button


HTML CODE:

<!DOCTYPE html>
<html>
<head>
    <title>page</title>
    <link rel="stylesheet" type="text/css" href="1.page.css">
</head>
<body>

    <a href="#">Button</a>

</body>
</html>

CSS CODE:

body{
    padding: 0;
    margin: 0;
    font-family: sans-serif;
    background: #262626;
}
a{
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%,-50%);
    padding: 15px 30px;
    text-transform: uppercase;
    text-decoration: none;
    color: #fff;
    letter-spacing: 2px;
    font-size: 20px;
}
a:before{
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #03a9f4;
    z-index: -1;
    transition: transform 0.5s;
    transform-origin: bottom right;
    transform: scale(0);
}
a:hover:before{
    transition: transform 0.5s;
    transform-origin:top left;
    transform: scale(1);
}
a:after{
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: transparent;
    border:2px solid #fff;
    z-index: -1;
    box-sizing: border-box;
    transition: transform 0.5s;
    transform-origin: top left;
    transform: scale(1);
}
a:hover:after{
    transition: transform 0.5s;
    transform-origin: bottom right;
    transform: scale(0);
}

One thought on “CSS Blue Button

Add yours

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Create a website or blog at WordPress.com

Up ↑

Design a site like this with WordPress.com
Get started