DEV Community

Prince
Prince

Posted on

Image in the Text animation effect code

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=
    , initial-scale=1.0">
    <title>Image Inside Text Effect</title>

    <style>
         @import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@600&display=swap');


         body{
            margin: 0;
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
            background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
            overflow: hidden;
            /* background: url('./jerry.png') ; */
         }

         .text-container{
            display: flex;

         }

         .letter{
            font-family: 'Montserrat', sans-serif;
            font-size: 9rem;
            font-weight: bolder;
            color: transparent;
        background: url('./jerry.png') no-repeat center center;
    background-size: cover;
    --webkit-background-clip:text;
    background-clip: text;
line-height: 1;         }











    </style>
</head>
<body>
    <div class="text-container">
        <span class="letter">P</span><span class="letter">R</span>
        <span class="letter">I</span>
        <span class="letter">N</span><span class="letter">C</span><span class="letter">E</span>
    </div>

</body>
</html>
Enter fullscreen mode Exit fullscreen mode

Top comments (0)