Animated Background Hero Template

Add a touch of modern sophistication to your site with a subtle, animated background.

This hero section uses pure CSS to create a calming effect of slowly drifting shapes, adding visual interest and a high-end feel without distracting from your core message.

Screenshot of a hero section with a subtle animated background of moving shapes.

Get Source Code Preview

About the Animated Background Hero

This template is ideal for creatives, agencies, and tech startups who want a modern look that feels alive but isn't overbearing. The slow-moving, semi-transparent shapes create a sense of depth and fluidity, elevating a simple hero section into something more memorable and polished.

Features

Code Breakdown

The component is delivered as CSS for the head and HTML for the body of your page.

The main hero section has position: relative and overflow: hidden. The animation is created by an unordered list (ul class="floating-shapes") that sits as a sibling to the main content container. The list items within it are the floating shapes. They are positioned absolutely at the bottom of the container and given varying sizes and opacities.

A CSS animation defined with @keyframes is applied to the list items. This animation uses the transform property to move the shapes from their starting position (bottom: -150px) to the top of the container (top: -150px). Each list item has a different animation-delay and animation-duration to create the randomized, asynchronous floating effect. The content itself is given a higher z-index to ensure it always appears on top of the moving shapes.

Code

View Output