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.

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
- Pure CSS Animation: The entire effect is built with CSS, making it extremely lightweight, performant, and reliable. No JavaScript needed.
- Subtle & Elegant: The animation is intentionally slow and non-intrusive, so it enhances the design rather than dominating it.
- Fully Responsive: The centered content and background effect work perfectly on all screen sizes.
- Customizable Shapes: Easily change the color, size, and number of floating shapes to match your brand's aesthetic.
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.