Skip to content

CSS Social Buttons

HTML CODE:

<!DOCTYPE html>
<html>
<head>
    <title>page</title>
     <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <link rel="stylesheet" type="text/css" href="1.page.css">
    <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.4.1/css/all.css">
</head>
<body>
    
    <div class="cardBox">
        <div class="card facebook">
            <div class="card-front"><i class="fab fa-facebook"></i></div>
            <div class="card-back">Facebook</div>

        </div>
    </div>
    <div class="cardBox">
        <div class="card twitter">
            <div class="card-front"><i class="fab fa-twitter"></i></div>
            <div class="card-back">Twitter</div>

        </div>
    </div>
    <div class="cardBox">
        <div class="card googleplus">
            <div class="card-front"><i class="fab fa-google-plus"></i></div>
            <div class="card-back">Google</div>

        </div>
    </div>

</body>
</html>

CSS CODE:

body{
    background: #292929;
    align-items: center;
    display: flex;
    justify-content: center;
    font-family: arial;
    height: 100vh;
}
.cardBox{
    perspective: 500px;
    margin: 15px;
}
.card{
    position: relative;
    width: 150px;
    height: 150px;
    background: #fff;
    transform-style: preserve-3d;
    transition: .5s ease;
    box-shadow: 0 30px 30px rgba(0,0,0,.5);
}
.facebook{
    background: #3b5998;
}
.twitter{
    background: #00aced;
}
.googleplus{
    background: #dd4b39;
}
.card-front , .card-back{
    position: absolute;
    top: 0;
    left: 0;
    width: 150px;
    height: 150px;
    color: #fff;
    backface-visibility: hidden;
}
.card-front{
    display: flex;
    font-size: 40px;
    justify-content: center;
    align-items: center;
}
.card-back{
    display: flex;
    font-size: 30px;
    justify-content: center;
    align-items: center;
}
.cardBox:hover .card{
    transform: rotateY(180deg);
}
.card-back{
    transform: rotateY(180deg);
}

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: