CSS

3D Text Hover Effect

Create stunning 3D text hover effect with transform and transition in HTML CSS only

8/12/2023
0 views
3D-text-hover-effect.htmlHTML
<!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>
CSSTutorialTransformTransition3D TextHover Effect

Related Examples