Sat Aug 12 2023

3D Text Hover Effect

CSS95 views
3D Text Hover Effect

File Name: 3D-text-hover-effect.html

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>3D Text Hover Effect</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=Hammersmith+One&display=swap" rel="stylesheet">
    <style>
        * {
            margin: 0;
            padding: 0;
            font-family: 'Hammersmith One', sans-serif;
        }

        body {
            background-color: #292929;
        }

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

        h1 {
            font-size: 50px;
            color: #f3494a;
            position: relative;
        }

        h1::before {
            position: absolute;
            content: attr(data-name);
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            color: #ff784e;
            transition: 0.3s all ease-in-out;
        }

        h1::after {
            position: absolute;
            content: attr(data-name);
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            color: #ffc03f;
            transition: 0.3s all ease-in-out;
        }

        h1:hover::before {
            transform: translate(5px, -5px);
        }

        h1:hover::after {
            transform: translate(10px, -10px);
        }
    </style>
</head>
<body>
    <section class="container">
        <h1 data-name="WebGraphiz.com">WebGraphiz.com</h1>
    </section>
</body>
</html>

Result Screenshot(s)

3D Text Hover 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.