This article will introduce to you how to achieve continuous enlargement of CSS3 triangles. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to everyone.

CSS3 triangle continuous enlargement effect
Picture preview

##index.html code
<!DOCTYPE html><html lang="en"> <head> <meta charset="UTF-8"> <title>CSS3三角形不断放大特效</title> <link rel="stylesheet" href="css/style.css"> </head> <body> <p class="wrapper"> <svg class="triangle-canvas" viewBox="0 0 1000 1000" xmlns="http://www.w3.org/2000/svg"> <polygon class="triangle triangle-1" points="500,200 759,650 241,650" /> <polygon class="triangle triangle-2" points="500,200 759,650 241,650" /> <polygon class="triangle triangle-3" points="500,200 759,650 241,650" /> <polygon class="triangle triangle-4" points="500,200 759,650 241,650" /> <polygon class="triangle triangle-5" points="500,200 759,650 241,650" /> <polygon class="triangle triangle-6" points="500,200 759,650 241,650" /> <polygon class="triangle triangle-7" points="500,200 759,650 241,650" /> <polygon class="triangle triangle-8" points="500,200 759,650 241,650" /> <polygon class="triangle triangle-9" points="500,200 759,650 241,650" /> <polygon class="triangle triangle-10" points="500,200 759,650 241,650" /> <polygon class="triangle triangle-11" points="500,200 759,650 241,650" /> <polygon class="triangle triangle-12" points="500,200 759,650 241,650" /> <polygon class="triangle triangle-13" points="500,200 759,650 241,650" /> <polygon class="triangle triangle-14" points="500,200 759,650 241,650" /> <polygon class="triangle triangle-15" points="500,200 759,650 241,650" /> <polygon class="triangle triangle-16" points="500,200 759,650 241,650" /> <polygon class="triangle triangle-17" points="500,200 759,650 241,650" /> <polygon class="triangle triangle-18" points="500,200 759,650 241,650" /> <polygon class="triangle triangle-19" points="500,200 759,650 241,650" /> <polygon class="triangle triangle-20" points="500,200 759,650 241,650" /> </svg> </p> </body></html>
style.css code
html {
height: 100%;}body {
padding: 0;
margin: 0;
height: 100%;
background: #642B73;
/* fallback for old browsers */
/* Chrome 10-25, Safari 5.1-6 */
background: linear-gradient(to left, #C6426E, #642B73);
/* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */}.wrapper {
overflow: hidden;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;}.triangle-canvas {
position: absolute;
left: 50%;
top: 50%;
width: 100%;
height: 100%;
-webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);}.triangle {
fill: none;
stroke: #fff;
stroke-width: 15;
-webkit-transform-origin: center center;
transform-origin: center center;
-webkit-animation: triangle-animation 10s linear infinite;
animation: triangle-animation 10s linear infinite;}.triangle-1 {
-webkit-animation-delay: 0s;
animation-delay: 0s;}.triangle-2 {
-webkit-animation-delay: -0.5s;
animation-delay: -0.5s;}.triangle-3 {
-webkit-animation-delay: -1s;
animation-delay: -1s;}.triangle-4 {
-webkit-animation-delay: -1.5s;
animation-delay: -1.5s;}.triangle-5 {
-webkit-animation-delay: -2s;
animation-delay: -2s;}.triangle-6 {
-webkit-animation-delay: -2.5s;
animation-delay: -2.5s;}.triangle-7 {
-webkit-animation-delay: -3s;
animation-delay: -3s;}.triangle-8 {
-webkit-animation-delay: -3.5s;
animation-delay: -3.5s;}.triangle-9 {
-webkit-animation-delay: -4s;
animation-delay: -4s;}.triangle-10 {
-webkit-animation-delay: -4.5s;
animation-delay: -4.5s;}.triangle-11 {
-webkit-animation-delay: -5s;
animation-delay: -5s;}.triangle-12 {
-webkit-animation-delay: -5.5s;
animation-delay: -5.5s;}.triangle-13 {
-webkit-animation-delay: -6s;
animation-delay: -6s;}.triangle-14 {
-webkit-animation-delay: -6.5s;
animation-delay: -6.5s;}.triangle-15 {
-webkit-animation-delay: -7s;
animation-delay: -7s;}.triangle-16 {
-webkit-animation-delay: -7.5s;
animation-delay: -7.5s;}.triangle-17 {
-webkit-animation-delay: -8s;
animation-delay: -8s;}.triangle-18 {
-webkit-animation-delay: -8.5s;
animation-delay: -8.5s;}.triangle-19 {
-webkit-animation-delay: -9s;
animation-delay: -9s;}.triangle-20 {
-webkit-animation-delay: -9.5s;
animation-delay: -9.5s;}@-webkit-keyframes triangle-animation {
0% {
-webkit-transform: scale(0) rotate(0deg);
transform: scale(0) rotate(0deg);
opacity: 1;
}
100% {
-webkit-transform: scale(3) rotate(45deg);
transform: scale(3) rotate(45deg);
opacity: 0;
}}@keyframes triangle-animation {
0% {
-webkit-transform: scale(0) rotate(0deg);
transform: scale(0) rotate(0deg);
opacity: 1;
}
100% {
-webkit-transform: scale(3) rotate(45deg);
transform: scale(3) rotate(45deg);
opacity: 0;
}}Recommended learning: The above is the detailed content of How to achieve continuous enlargement of CSS3 triangles. For more information, please follow other related articles on the PHP Chinese website!
Two Images and an API: Everything We Need for Recoloring ProductsApr 15, 2025 am 11:27 AMI recently found a solution to dynamically update the color of any product image. So with just one of a product, we can colorize it in different ways to show
Weekly Platform News: Impact of Third-Party Code, Passive Mixed Content, Countries with the Slowest ConnectionsApr 15, 2025 am 11:19 AMIn this week's roundup, Lighthouse sheds light on third-party scripts, insecure resources will get blocked on secure sites, and many country connection speeds
Options for Hosting Your Own Non-JavaScript-Based AnalyticsApr 15, 2025 am 11:09 AMThere are loads of analytics platforms to help you track visitor and usage data on your sites. Perhaps most notably Google Analytics, which is widely used
It's All In the Head: Managing the Document Head of a React Powered Site With React HelmetApr 15, 2025 am 11:01 AMThe document head might not be the most glamorous part of a website, but what goes into it is arguably just as important to the success of your website as its
What is super() in JavaScript?Apr 15, 2025 am 10:59 AMWhat's happening when you see some JavaScript that calls super()?.In a child class, you use super() to call its parent’s constructor and super. to access its
Comparing the Different Types of Native JavaScript PopupsApr 15, 2025 am 10:48 AMJavaScript has a variety of built-in popup APIs that display special UI for user interaction. Famously:
Why Are Accessible Websites so Hard to Build?Apr 15, 2025 am 10:45 AMI was chatting with some front-end folks the other day about why so many companies struggle at making accessible websites. Why are accessible websites so hard
The `hidden` Attribute is Visibly WeakApr 15, 2025 am 10:43 AMThere is an HTML attribute that does exactly what you think it should do:


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Atom editor mac version download
The most popular open source editor

Dreamweaver CS6
Visual web development tools

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function







