Fri Sep 02 2022

Youtube Like i Button Effect

CSS3249 views

File Name: youtube-i-button-effect.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>Youtube Like I Button Animation</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=Lato:wght@400;700&display=swap" rel="stylesheet"> 
    <style>
        * {
            padding: 0;
            margin: 0;
            font-family: 'Lato', sans-serif;
        }

        body {
            background-color: #292929;
        }

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

        #videoFrame {
            width: 450px;
            height: 250px;
            background-color: #121212;
            box-shadow: 0 0 20px 0 #121212;
            position: relative;
            overflow: hidden;
        }        

        #videoFrame a.suggestion {
            position: absolute;
            top: 10px;
            right: 10px;
            z-index: 5;
            text-decoration: none;
            display: flex;
            justify-content: center;
            align-items: center;
            width: 20px;
            height: 20px;
            border-radius: 100%;
            background-color: #fff;
            font-weight: bold;
            font-size: 18px;
            cursor: pointer;
            color: #121212;
        }

        #videoFrame a.suggestion::before {
            position: absolute;
            content: attr(data-info);
            background-color: transparent;
            font-weight: normal;
            width: 200px;
            white-space: nowrap;
            left: 200px;
            padding: 3px 5px;
            border-radius: 3px;
            font-size: 15px;
            z-index: -1;
            transition: 0.3s all ease-in-out;
            opacity: 0;
            visibility: hidden;
        }

        #videoFrame a.suggestion:hover::before {
            left: -190px;
            background-color: #fff;
            opacity: 1;
            visibility: visible;
        }
        
    </style>
</head>
<body>
    <section>
        <div id="videoFrame">
            <a href="" class="suggestion" data-info="Suggested: Your Video Title">i</a>
        </div>
    </section>
</body>
</html>

Result Screenshot(s)

Youtube Like i Button EffectWorking Sample0

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