Sat Oct 08 2022

Social Icon with Tooltips

CSS3378 views

Social Icon with Tooltips

File Name: index.html

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Social Icon with Tooltips</title>
    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
    <link href="https://fonts.googleapis.com/css2?family=Heebo&display=swap" rel="stylesheet"> 
    <style>
        * {
            margin: 0;
            padding: 0;
            font-family: 'Heebo', sans-serif;
        }

        :root {
            --facebook: #3a5796;
            --twitter: #1c9ceb;
            --linkedin: #0371ae;
            --instagram: #d12c7a;
        }

        body { background-color: #ccc; }

        section {
            display: flex;
            justify-content: center;
            align-items: center;
            width: 100%;
            height: 100vh;
        }

        nav {
            width: 450px;
            display: flex;
            justify-content: space-between;
        }

        a {
            width: 80px;
            height: 80px;
            background-color: #fff;
            display: flex;
            justify-content: center;
            align-items: center;
            border-radius: 100%;
            position: relative;
            box-shadow: -5px 5px 10px rgba(0, 0, 0, 0.5);
            transition: 0.3s all ease-in-out;
        }

        a svg {
            width: 30px;
            height: 30px;
        }

        a svg path,
        a svg circle {
            transition: 0.3s all ease-in-out;
        }

        a span {
            position: absolute;
            color: #fff;
            transform: translateY(0px);
            font-size: 18px;
            padding: 5px 10px;
            border-radius: 5px;
            visibility: hidden;
            opacity: 0;
            transition: 0.3s all cubic-bezier(0.175, 0.885, 0.32, 1.275);
            transition-delay: 0s;
        }

        a span::before {
            position: absolute;
            content: '';
            border-left: 5px solid transparent;
            border-right: 5px solid transparent;
            border-top: 5px solid #fff;
            bottom: -5px;
            left: 50%;
            transform: translateX(-50%);
        }

        a.facebook span {
            background-color: var(--facebook);
        }

        a.facebook span::before {
            border-top-color: var(--facebook);
        }

        a.twitter span {
            background-color: var(--twitter);
        }

        a.twitter span::before {
            border-top-color: var(--twitter);
        }

        a.linkedin span {
            background-color: var(--linkedin);
        }

        a.linkedin span::before {
            border-top-color: var(--linkedin);
        }

        a.instagram span {
            background-color: var(--instagram);
        }

        a.instagram span::before {
            border-top-color: var(--instagram);
        }

        a.active,
        a:hover {
            box-shadow: -20px 20px 30px rgba(0, 0, 0, 0.5);
        }

        a.facebook:hover {
            background-color: var(--facebook);
        }

        a.twitter:hover {
            background-color: var(--twitter);
        }

        a.linkedin:hover {
            background-color: var(--linkedin);
        }

        a.instagram.active,
        a.instagram:hover {
            background-color: var(--instagram);
        }

        a.active span,
        a:hover span {
            transform: translateY(-80px);
            visibility: visible;
            opacity: 1;
            transition-delay: 0.2s;
        }

        a.active svg path,
        a.active svg circle,
        a:hover svg path,
        a:hover svg circle {
            fill: #fff;
        }
    </style>
</head>
<body>
    <section>
        <nav>
            <a href="" class="facebook">
                <span>Facebook</span>
                <svg viewBox="0 0 126.22 246"><path d="M173.6,27h35.92V70.19h-29.7c-15,2.39-14,19.79-14,19.79v29.33h47.27l-7.05,47.52H166.33V273H119.19V166.09H86.89V119.31h32.3V87.74A68.5,68.5,0,0,1,127,55.49c5.27-9.87,14-20.18,28.41-25.47A53,53,0,0,1,173.6,27Z" transform="translate(-86.89 -27)"/></svg> 
            </a>
            <a href="" class="twitter">
                <span>Twitter</span>
                <svg viewBox="0 0 245.97 198.8"><path d="M44.28,59.23S89.07,113,147.62,111C140.12,86,172.14,21.7,234,65.49c0,0,24.77-5.26,32.28-12.51,0,0-3.5,14.76-20.77,27.52,0,0-1.25,2.5,27.53-6.76,0,0-12.27,16.77-25.28,26,0,0,7.18,101-91.91,141,0,0-60.72,26.69-128.79-14,0,0,40.71,6.67,74.4-20.69,0,0-38.36-3.67-46.37-35.36,0,0,13.35,3.67,22-1,0,0-36-4-39.7-49.71,0,0,17,7.33,22.35,6.33C59.71,126.37,23.85,104.52,44.28,59.23Z" transform="translate(-27.01 -50.6)"/></svg>
            </a>
            <a href="" class="linkedin">
                <span>Linkedin</span>
                <svg viewBox="0 0 244.65 226.28"><path d="M35.73,81.63a24.22,24.22,0,0,1-8-18.5,24.59,24.59,0,0,1,8-18.79q8.06-7.47,20.76-7.48,12.43,0,20.48,7.48a24.59,24.59,0,0,1,8,18.79,24.22,24.22,0,0,1-8,18.5q-8,7.5-20.48,7.49Q43.79,89.12,35.73,81.63ZM80.5,105.51V263.14H32.2V105.51Z" transform="translate(-27.68 -36.86)"/><path d="M255.8,121.75q16.51,17.94,16.52,49.3v92.09h-48v-85.6q0-15.81-8.19-24.57t-22-8.76q-13.84,0-22,8.76t-8.2,24.57v85.6H115.53V105.51h48.31v20.9a51.15,51.15,0,0,1,19.78-16.53,63,63,0,0,1,28-6.07Q239.27,103.81,255.8,121.75Z" transform="translate(-27.68 -36.86)"/></svg>
            </a>
            <a href="" class="instagram">
                <span>Instagram</span>
                <svg viewBox="0 0 246.15 246.15"><path d="M201,51.5A47.49,47.49,0,0,1,248.41,99V200.88A47.49,47.49,0,0,1,201,248.32H99a47.49,47.49,0,0,1-47.44-47.44V99A47.49,47.49,0,0,1,99,51.5H201m0-24.66H99A72.11,72.11,0,0,0,26.92,99V200.88A72.12,72.12,0,0,0,99,273H201a72.12,72.12,0,0,0,72.11-72.11V99A72.11,72.11,0,0,0,201,26.84Z" transform="translate(-26.92 -26.84)"/><path class="cls-1" d="M150,124.34a25.57,25.57,0,1,1-25.57,25.57A25.6,25.6,0,0,1,150,124.34m0-24.66a50.24,50.24,0,1,0,50.23,50.23A50.23,50.23,0,0,0,150,99.68Z" transform="translate(-26.92 -26.84)"/><circle class="cls-1" cx="189.98" cy="55.33" r="13.81"/></svg>
            </a>
        </nav>
    </section>
</body>
</html>

Result Screenshot(s)

Social Icon with TooltipsWorking Sample0
Reference:

We use cookies to improve your experience on our site and to show you personalised advertising. Please read our cookie policy and privacy policy.