CSS Birthday Cake
How do I make an css birthday cake?
Made on a whim for a fellow codepen users birthday.. What is a css birthday cake? How do you make a css birthday cake? This script and codes were developed by Mark Thomes on 04 July 2022, Monday.
CSS Birthday Cake - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>CSS Birthday Cake</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css"> <link rel='stylesheet prefetch' href='css/7534eb3fb62294822de9eace9.css'> <style> /* NOTE: The styles were added inline because Prefixfree needs access to your styles and they must be inlined if they are on local disk! */ body { background-color: #333;
}
.cake { position: absolute; width: 250px; height: 200px; top: 50%; left: 50%; margin-top: -70px; margin-left: -125px;
}
.plate { width: 270px; height: 110px; position: absolute; bottom: -10px; left: -10px; background-color: #ccc; border-radius: 50%; box-shadow: 0 2px 0 #b3b3b3, 0 4px 0 #b3b3b3, 0 5px 40px rgba(0, 0, 0, 0.5);
}
.cake > * { position: absolute;
}
.layer { position: absolute; display: block; width: 250px; height: 100px; border-radius: 50%; background-color: #553c13; box-shadow: 0 2px 0px #6a4b18, 0 4px 0px #33240b, 0 6px 0px #32230b, 0 8px 0px #31230b, 0 10px 0px #30220b, 0 12px 0px #2f220b, 0 14px 0px #2f210a, 0 16px 0px #2e200a, 0 18px 0px #2d200a, 0 20px 0px #2c1f0a, 0 22px 0px #2b1f0a, 0 24px 0px #2a1e09, 0 26px 0px #2a1d09, 0 28px 0px #291d09, 0 30px 0px #281c09;
}
.layer-top { top: 0px;
}
.layer-middle { top: 33px;
}
.layer-bottom { top: 66px;
}
.icing { top: 2px; left: 5px; background-color: #f0e4d0; width: 240px; height: 90px; border-radius: 50%;
}
.icing:before { content: ""; position: absolute; top: 4px; right: 5px; bottom: 6px; left: 5px; background-color: #f4ebdc; box-shadow: 0 0 4px #f6efe3, 0 0 4px #f6efe3, 0 0 4px #f6efe3; border-radius: 50%; z-index: 1;
}
.drip { display: block; width: 50px; height: 60px; border-bottom-left-radius: 25px; border-bottom-right-radius: 25px; background-color: #f0e4d0;
}
.drip1 { top: 53px; left: 5px; transform: skewY(15deg); height: 48px; width: 40px;
}
.drip2 { top: 69px; left: 181px; transform: skewY(-15deg);
}
.drip3 { top: 54px; left: 90px; width: 80px; border-bottom-left-radius: 40px; border-bottom-right-radius: 40px;
}
.candle { background-color: #7B020B; width: 16px; height: 50px; border-radius: 8px / 4px; top: -20px; left: 50%; margin-left: -8px; z-index: 10;
}
.candle:before { content: ""; position: absolute; top: 0; left: 0; width: 16px; height: 8px; border-radius: 50%; background-color: #ad030f;
}
.flame { position: absolute; background-color: orange; width: 15px; height: 35px; border-radius: 10px 10px 10px 10px / 25px 25px 10px 10px; top: -34px; left: 50%; margin-left: -7.5px; z-index: 10; box-shadow: 0 0 10px rgba(255, 165, 0, 0.5), 0 0 20px rgba(255, 165, 0, 0.5), 0 0 60px rgba(255, 165, 0, 0.5), 0 0 80px rgba(255, 165, 0, 0.5); transform-origin: 50% 90%; animation: flicker 1s ease-in-out alternate infinite;
}
@keyframes flicker { 0% { transform: skewX(5deg); box-shadow: 0 0 10px rgba(255, 165, 0, 0.2), 0 0 20px rgba(255, 165, 0, 0.2), 0 0 60px rgba(255, 165, 0, 0.2), 0 0 80px rgba(255, 165, 0, 0.2); } 25% { transform: skewX(-5deg); box-shadow: 0 0 10px rgba(255, 165, 0, 0.5), 0 0 20px rgba(255, 165, 0, 0.5), 0 0 60px rgba(255, 165, 0, 0.5), 0 0 80px rgba(255, 165, 0, 0.5); } 50% { transform: skewX(10deg); box-shadow: 0 0 10px rgba(255, 165, 0, 0.3), 0 0 20px rgba(255, 165, 0, 0.3), 0 0 60px rgba(255, 165, 0, 0.3), 0 0 80px rgba(255, 165, 0, 0.3); } 75% { transform: skewX(-10deg); box-shadow: 0 0 10px rgba(255, 165, 0, 0.4), 0 0 20px rgba(255, 165, 0, 0.4), 0 0 60px rgba(255, 165, 0, 0.4), 0 0 80px rgba(255, 165, 0, 0.4); } 100% { transform: skewX(5deg); box-shadow: 0 0 10px rgba(255, 165, 0, 0.5), 0 0 20px rgba(255, 165, 0, 0.5), 0 0 60px rgba(255, 165, 0, 0.5), 0 0 80px rgba(255, 165, 0, 0.5); }
} </style> <script src="https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js"></script>
</head>
<body> <div class="cake"> <div class="plate"></div> <div class="layer layer-bottom"></div> <div class="layer layer-middle"></div> <div class="layer layer-top"></div> <div class="icing"></div> <div class="drip drip1"></div> <div class="drip drip2"></div> <div class="drip drip3"></div> <div class="candle"> <div class="flame"></div> </div>
</div> <script src='https://code.jquery.com/jquery-2.2.4.min.js'></script>
<script src='https://s3-us-west-2.amazonaws.com/s.cdpn.io/15979/footer-inject.js'></script>
</body>
</html>
CSS Birthday Cake - Script Codes CSS Codes
body { background-color: #333;
}
.cake { position: absolute; width: 250px; height: 200px; top: 50%; left: 50%; margin-top: -70px; margin-left: -125px;
}
.plate { width: 270px; height: 110px; position: absolute; bottom: -10px; left: -10px; background-color: #ccc; border-radius: 50%; box-shadow: 0 2px 0 #b3b3b3, 0 4px 0 #b3b3b3, 0 5px 40px rgba(0, 0, 0, 0.5);
}
.cake > * { position: absolute;
}
.layer { position: absolute; display: block; width: 250px; height: 100px; border-radius: 50%; background-color: #553c13; box-shadow: 0 2px 0px #6a4b18, 0 4px 0px #33240b, 0 6px 0px #32230b, 0 8px 0px #31230b, 0 10px 0px #30220b, 0 12px 0px #2f220b, 0 14px 0px #2f210a, 0 16px 0px #2e200a, 0 18px 0px #2d200a, 0 20px 0px #2c1f0a, 0 22px 0px #2b1f0a, 0 24px 0px #2a1e09, 0 26px 0px #2a1d09, 0 28px 0px #291d09, 0 30px 0px #281c09;
}
.layer-top { top: 0px;
}
.layer-middle { top: 33px;
}
.layer-bottom { top: 66px;
}
.icing { top: 2px; left: 5px; background-color: #f0e4d0; width: 240px; height: 90px; border-radius: 50%;
}
.icing:before { content: ""; position: absolute; top: 4px; right: 5px; bottom: 6px; left: 5px; background-color: #f4ebdc; box-shadow: 0 0 4px #f6efe3, 0 0 4px #f6efe3, 0 0 4px #f6efe3; border-radius: 50%; z-index: 1;
}
.drip { display: block; width: 50px; height: 60px; border-bottom-left-radius: 25px; border-bottom-right-radius: 25px; background-color: #f0e4d0;
}
.drip1 { top: 53px; left: 5px; transform: skewY(15deg); height: 48px; width: 40px;
}
.drip2 { top: 69px; left: 181px; transform: skewY(-15deg);
}
.drip3 { top: 54px; left: 90px; width: 80px; border-bottom-left-radius: 40px; border-bottom-right-radius: 40px;
}
.candle { background-color: #7B020B; width: 16px; height: 50px; border-radius: 8px / 4px; top: -20px; left: 50%; margin-left: -8px; z-index: 10;
}
.candle:before { content: ""; position: absolute; top: 0; left: 0; width: 16px; height: 8px; border-radius: 50%; background-color: #ad030f;
}
.flame { position: absolute; background-color: orange; width: 15px; height: 35px; border-radius: 10px 10px 10px 10px / 25px 25px 10px 10px; top: -34px; left: 50%; margin-left: -7.5px; z-index: 10; box-shadow: 0 0 10px rgba(255, 165, 0, 0.5), 0 0 20px rgba(255, 165, 0, 0.5), 0 0 60px rgba(255, 165, 0, 0.5), 0 0 80px rgba(255, 165, 0, 0.5); transform-origin: 50% 90%; animation: flicker 1s ease-in-out alternate infinite;
}
@keyframes flicker { 0% { transform: skewX(5deg); box-shadow: 0 0 10px rgba(255, 165, 0, 0.2), 0 0 20px rgba(255, 165, 0, 0.2), 0 0 60px rgba(255, 165, 0, 0.2), 0 0 80px rgba(255, 165, 0, 0.2); } 25% { transform: skewX(-5deg); box-shadow: 0 0 10px rgba(255, 165, 0, 0.5), 0 0 20px rgba(255, 165, 0, 0.5), 0 0 60px rgba(255, 165, 0, 0.5), 0 0 80px rgba(255, 165, 0, 0.5); } 50% { transform: skewX(10deg); box-shadow: 0 0 10px rgba(255, 165, 0, 0.3), 0 0 20px rgba(255, 165, 0, 0.3), 0 0 60px rgba(255, 165, 0, 0.3), 0 0 80px rgba(255, 165, 0, 0.3); } 75% { transform: skewX(-10deg); box-shadow: 0 0 10px rgba(255, 165, 0, 0.4), 0 0 20px rgba(255, 165, 0, 0.4), 0 0 60px rgba(255, 165, 0, 0.4), 0 0 80px rgba(255, 165, 0, 0.4); } 100% { transform: skewX(5deg); box-shadow: 0 0 10px rgba(255, 165, 0, 0.5), 0 0 20px rgba(255, 165, 0, 0.5), 0 0 60px rgba(255, 165, 0, 0.5), 0 0 80px rgba(255, 165, 0, 0.5); }
}
Developer | Mark Thomes |
Username | WithAnEs |
Uploaded | July 04, 2022 |
Rating | 4.5 |
Size | 8,353 Kb |
Views | 54,648 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
Hiding in a box | 3,138 Kb |
Social Icons | 8,247 Kb |
Popup Footer | 3,488 Kb |
SVG Search... | 7,601 Kb |
Save Bar | 2,719 Kb |
Sidebar Nav | 3,808 Kb |
CSS3 Gradient Stripes | 6,259 Kb |
Twitter Feed Loading Animation | 6,763 Kb |
Up Arrow | 7,830 Kb |
CSS Books | 7,833 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
A Pen by Jonas Bjork | Jonasbjork | 3,115 Kb |
Modular Flip Card | Bbodine1 | 4,009 Kb |
Sticky div | Kaslab | 2,225 Kb |
Infractions - Attitude | Kylie_Joseph | 7,672 Kb |
Magnus 3 | ARocketfish | 7,944 Kb |
Heatmap Color Scales | Stevepepple | 2,331 Kb |
Em Test | Rodesco | 1,784 Kb |
Colorful Sliders | Chanrith | 1,246 Kb |
Count up | Alanshortis | 2,391 Kb |
Banner Ad | Raquellorenzana | 4,172 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!