Sun Aug 28 2022

Animated Image Caption

CSS0 views

File Name: animated-image-caption.html

<!DOCTYPE html>
<html lang="en">
    <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>Animated Image Caption</title>
    <link rel="preconnect" href="">
    <link rel="preconnect" href="" crossorigin>
    <link href="" rel="stylesheet"> 
        * {
            margin: 0;
            padding: 0;
            font-family: 'Nunito', sans-serif;
        body {
            background-color: #292929;

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

        #usr {
            width: 300px;
            height: 300px;
            background-image: url('');
            background-repeat: no-repeat;
            background-size: cover;
            background-position: center;
            border-radius: 100%;
            position: relative;

        #usr::before {
            position: absolute;
            content: attr(data-name);
            display: flex;
            justify-content: center;
            align-items: center;
            top: 0;
            left: 0;
            bottom: 0;
            right: 0;
            background-color: #5570d9;
            border-radius: 100%;
            font-size: 40px;
            font-weight: 300;
            color: #fff;
            letter-spacing: 3px;
            transform: rotate(360deg) translate(50%, -30%) scale(0.5);
            transition: 0.2s letter-spacing ease-in-out,
                        0.6s transform ease-in-out;

        #usr:hover::before {
            background-color: #5570d9b2;
            letter-spacing: 10px;
            transform: rotate(0deg) translate(0%) scale(1);
            transition: 0.6s transform ease-in-out,
                        2s letter-spacing ease-in-out;

        <div id="usr" data-name="Latika"></div>

Result Screenshot(s)

Animated Image CaptionWorking 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.