https://codepen.io/jonmilner/pen/bfkKF belki yararlı örneğidir.
<div class="social-icons">
<a class="social-icon social-icon--codepen">
<i class="fa fa-codepen"></i>
<div class="tooltip">Codepen</div>
</div>
body {
display: flex;
align-items: center;
justify-content: center;
min-height: 100vh;
}
/* Color Variables */
$color-codepen: #000;
/* Social Icon Mixin */
@mixin social-icon($color) {
background: $color;
background: linear-gradient(tint($color, 5%), shade($color, 5%));
border-bottom: 1px solid shade($color, 20%);
color: tint($color, 50%);
&:hover {
color: tint($color, 80%);
text-shadow: 0px 1px 0px shade($color, 20%);
}
.tooltip {
background: $color;
background: linear-gradient(tint($color, 15%), $color);
color: tint($color, 80%);
&:after {
border-top-color: $color;
}
}
}
/* Social Icons */
.social-icons {
display: flex;
}
.social-icon {
display: flex;
align-items: center;
justify-content: center;
position: relative;
width: 80px;
height: 80px;
margin: 0 0.5rem;
border-radius: 50%;
cursor: pointer;
font-family: "Helvetica Neue", "Helvetica", "Arial", sans-serif;
font-size: 2.5rem;
text-decoration: none;
text-shadow: 0 1px 0 rgba(0,0,0,0.2);
transition: all 0.15s ease;
&:hover {
color: #fff;
.tooltip {
visibility: visible;
opacity: 1;
transform: translate(-50%, -150%);
}
}
&:active {
box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.5) inset;
}
&--codepen { @include social-icon($color-codepen); }
i {
position: relative;
top: 1px;
}
}
/* Tooltips */
.tooltip {
display: block;
position: absolute;
top: 0;
left: 50%;
padding: 0.8rem 1rem;
border-radius: 3px;
font-size: 0.8rem;
font-weight: bold;
opacity: 0;
pointer-events: none;
text-transform: uppercase;
transform: translate(-50%, -100%);
transition: all 0.3s ease;
z-index: 1;
&:after {
display: block;
position: absolute;
bottom: 0;
left: 50%;
width: 0;
height: 0;
content: "";
border: solid;
border-width: 10px 10px 0 10px;
border-color: transparent;
transform: translate(-50%, 100%);
}
}
Tamam, sanırım jsfiddle ile birlikte gönderilecek kod gerektiren yeni bir özellik var. Sadece bunu yaparken sorun yaşıyorum, bu yüzden yukarıdaki tüm komik gösteriliyor. Herhangi birinizin orijinal gönderiye ait bazı fikirleri varsa, tavsiyelerinizi memnuniyetle karşılarım. – Harriet