Posted on March 20, 2021, 8 p.m. by Bishal ( 12390)
transform
property to rotate the texts 360 degrees and you can also customize the angles with your own values. The CSS transform
property helps to achieve a 2D or 3D animation to an element. The transform property supports rotate, scale, skew etc an element..element{ transform: _ }
index.html
index.html
<!DOCTYPE html>
<html>
<head>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.1/css/all.min.css">
<title>Social Media Share Button - Code With Bishal</title>
</head>
<!-- created by Code With Bishal - www.codewithbishal.com
-->
<body>
</body>
</html>
style.css
<head> </head>
of your HTML document:<link href="style.css" rel="stylesheet">
.wrapper {
display: inline-flex;
padding: 20%;
}
.wrapper .icon {
position: relative;
background-color: #ffffff;
margin: 10px;
width: 50px;
height: 50px;
font-size: 18px;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
box-shadow: 0 10px 10px rgba(0, 0, 0, 0.1);
cursor: pointer;
}
.wrapper .tooltip {
top: 0;
font-size: 14px;
color: #ffffff;
padding: 5px 8px;
border-radius: 5px;
opacity: 0;
pointer-events: none;
transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}
.wrapper .icon:hover .tooltip {
top: -45px;
opacity: 1;
}
<!DOCTYPE html>
<html>
<head>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.1/css/all.min.css">
<title>Social Media Share Button - Code With Bishal</title>
</head>
<!-- created by Code With Bishal - www.codewithbishal.com
-->
<body>
<div class="wrapper">
<div class="icon instagram">
<div class="tooltip">Instagram</div>
<span><i class="fab fa-instagram"></i></span>
</div>
<div class="icon github">
<div class="tooltip">Github</div>
<span><i class="fab fa-github"></i></span>
</div>
<div class="icon youtube">
<div class="tooltip">Youtube</div>
<span><i class="fab fa-youtube"></i></span>
</div>
<div class="icon facebook">
<div class="tooltip">Facebook</div>
<span><i class="fab fa-facebook-f"></i></span>
</div>
<div class="icon twitter">
<div class="tooltip">Twitter</div>
<span><i class="fab fa-twitter"></i></span>
</div>
</div>
</body>
</html>
.wrapper {
display: inline-flex;
padding: 20%;
}
.wrapper .icon {
position: relative;
background-color: #ffffff;
margin: 10px;
width: 50px;
height: 50px;
font-size: 18px;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
box-shadow: 0 10px 10px rgba(0, 0, 0, 0.1);
cursor: pointer;
}
.wrapper .tooltip {
top: 0;
font-size: 14px;
color: #ffffff;
padding: 5px 8px;
border-radius: 5px;
opacity: 0;
pointer-events: none;
transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}
.wrapper .icon:hover .tooltip {
top: -45px;
opacity: 1;
}
.wrapper .facebook:hover .tooltip{
transform: rotate(360deg);
background-color: #3b5999;
}
.wrapper .twitter:hover .tooltip{
background-color: #46c1f6;
transform: rotate(360deg);
}
.wrapper .instagram:hover .tooltip{
background-color: #e1306c;
transform: rotate(360deg);
}
.wrapper .github:hover .tooltip{
background-color: #333333;
color: #ffffff;
transform: rotate(360deg);
}
.wrapper .youtube:hover .tooltip{
background-color: #de463b;
transform: rotate(360deg);
}
@media (max-width: 600px) {
.wrapper {
display: block;
}
}