Skip to content
Advertisements

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

1 Comment »

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

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

%d bloggers like this: