Toggle navigation
☰
HTML
CSS
Scripting
Database
<!doctype html> <title>Example</title> <style> body { display: flex; justify-content: center; align-items: center; height: 100vh; margin: 0; font-family: sans-serif; background-color: #f0f0f0; } .skeleton-card { width: 300px; padding: 20px; background: #fff; border-radius: 8px; box-shadow: 0 4px 6px rgba(0,0,0,0.1); } .skeleton-line { height: 15px; margin-bottom: 10px; border-radius: 4px; background-color: #e2e5e7; /* The gradient is twice as wide as the element to allow it to slide across */ background-image: linear-gradient( 90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0) ); background-size: 200% 100%; animation: shimmer 1.5s infinite linear; } .skeleton-line:last-child { width: 60%; margin-bottom: 0; } .skeleton-avatar { width: 50px; height: 50px; border-radius: 50%; margin-bottom: 15px; background-color: #e2e5e7; background-image: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0)); background-size: 200% 100%; animation: shimmer 1.5s infinite linear; } @keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } } @media (prefers-reduced-motion: reduce) { .skeleton-line, .skeleton-avatar { animation: none; background-image: none; } } </style> <div class="skeleton-card" aria-hidden="true"> <div class="skeleton-avatar"></div> <div class="skeleton-line"></div> <div class="skeleton-line"></div> <div class="skeleton-line"></div> </div>