Published on December 12th, 2024
Introduction
The holiday season is a time for festive creativity, and what better way to spread some cheer than by adding falling snowflakes to your HTML email campaigns? While adding animations to HTML emails presents challenges due to strict limitations in email client support, CSS animations can still be used effectively in certain email clients. In this article, we’ll walk through how to create a falling snowflake effect in HTML emails using CSS animations, and we’ll also explore some ideas for applying this effect year-round.
A Fun and Memorable Holiday Touch
At Sinch Email on Acid, we’ve made it a tradition to share a holiday tutorial on how to use CSS animations to create falling snowflakes in HTML emails. This annual tradition brings some winter magic into the inbox, delighting subscribers and setting the stage for higher engagement and open rates. Thanks to Jay Oram from ActionRocket, who first introduced this technique six years ago, we’ve been able to continue this fun holiday project.
In this tutorial, we’ll focus on creating snowflakes that appear in the foreground of your emails, giving your campaigns an added layer of depth. This effect is subtle but powerful—perfect for creating a sense of seasonal wonder.
The Challenge of Animations in Email Clients
Email client support for CSS animations is far from perfect. Only some email clients, like Apple Mail, iOS Mail, Outlook for Mac, and Samsung Email, support CSS animations using WebKit. These clients are able to render animations correctly, but others, such as Gmail and older versions of Outlook, may not display the animation as intended. That’s why it’s important to understand which clients will support these effects and how to work around these limitations.
With that said, if you focus on the email clients that do support CSS animations, this snowflake effect can be a delightful addition to your email marketing strategy.
Step 1: Setting Up the Snowflake Container
To begin, we’ll create a container for our snowflakes. This container will hold our snowflake elements and ensure they’re positioned correctly on the page.
cssCopy code@media screen and (-webkit-min-device-pixel-ratio: 0) {
/* This media query ensures that only email clients supporting WebKit will render the animations */
}
.snowcontainer {
position: relative;
width: 100%;
overflow: visible; /* Allows snowflakes to fall outside the container */
}
Step 2: Creating Snowflakes
You can create snowflakes using simple shapes or images. Here’s how to define a snowflake as a shape. We’ll use a circle as the snowflake, but you could also use a background image like a snowflake PNG.
Snowflake Shape (Circle)
cssCopy code.snow {
height: 18px;
border-radius: 9px; /* To create a perfect circle */
width: 18px;
position: absolute;
top: -20px; /* Start above the container */
background-color: #ffffff; /* White color */
}
Snowflake Image
Alternatively, you can use an image for your snowflakes. This method uses a background image to create the snowflake effect.
cssCopy code.snowimage {
height: 18px;
width: 18px;
position: absolute;
top: -20px;
background-image: url('images/snowflake.png'); /* Use a transparent PNG image */
}
Step 3: Animating the Snowflakes
Now, it’s time to add the animation to make the snowflakes fall. We’ll use CSS keyframes to define the movement of the snowflakes from the top of the container to the bottom, with a random drift effect.
cssCopy code.snow1 {
animation: snow1 5s linear 0s infinite;
}
@keyframes snow1 {
0% {
top: 0%;
left: 50%;
}
100% {
top: 100%;
left: 65%;
}
}
.snow2 {
animation: snow2 6s linear 1s infinite;
}
@keyframes snow2 {
0% {
top: 0%;
left: 30%;
}
100% {
top: 100%;
left: 25%;
}
}
.snow3 {
animation: snow3 7s linear 2s infinite;
}
@keyframes snow3 {
0% {
top: 0%;
left: 70%;
}
100% {
top: 100%;
left: 60%;
}
}
The keyframes define the starting and ending positions of the snowflakes. By slightly altering the left position in each animation (e.g., left: 50% vs. left: 30%), the snowflakes will fall in a more random pattern, giving the effect of natural snowfall.
Step 4: Adding the Snowflakes to Your HTML
Now that you’ve created your CSS animations, you can implement them in your HTML email. Below is the structure for how to set up the HTML for the snowflake animation:
htmlCopy code<div class="snowcontainer">
<div class="snow snow1"></div>
<div class="snow snow2"></div>
<div class="snow snow3"></div>
<!-- Add more snowflakes as needed -->
</div>
<!-- Your email content goes here -->
Each <div> inside the .snowcontainer represents an individual snowflake. You can add more snowflakes by duplicating these div elements and assigning them different animation classes (snow1, snow2, etc.).
Step 5: Testing and Client Support
Testing is crucial when implementing CSS animations in emails. As mentioned earlier, not all email clients support these animations. Using a tool like Email on Acid or Litmus, you can test your email across different email clients to ensure it renders as expected.
Email Client Support Summary:
- Apple Mail: Supports CSS animations
- iOS Mail: Supports CSS animations
- Outlook for Mac: Supports CSS animations
- Gmail: Does not support CSS animations (use fallback or static images)
- Outlook (Windows): Does not support CSS animations
Creative Ideas for Using CSS Animations Year-Round
While falling snowflakes are perfect for the holiday season, the CSS animation technique can be adapted for various occasions throughout the year:
- Autumn Leaves: Use falling leaves for fall-themed emails, or even for back-to-school promotions.
- Confetti: Celebrate milestones or events like birthdays, anniversaries, or product launches with colorful falling confetti.
- Raining Code: For tech-savvy audiences, consider a matrix-style animation with raining code.
The possibilities are endless, and with a bit of creativity, you can surprise and delight your subscribers at any time of the year.
Conclusion
Using CSS animations to create falling snowflakes in HTML emails adds a magical touch to your holiday campaigns and can set you apart from the competition. While there are limitations in email client support, focusing on clients that render the animations correctly can still give you a beautiful, festive effect. By testing and tailoring your emails for different clients, you can create memorable email experiences that delight your subscribers and increase engagement.
Whether it’s snowflakes, confetti, or something else entirely, CSS animations can be an excellent way to make your email campaigns stand out during the holiday season and beyond. Happy coding, and may your emails bring some seasonal joy to your audience!

