纯css绘制一个蝴蝶效果代码
代码语言:html
所属分类:布局界面
代码描述:纯css绘制一个蝴蝶效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <style> html{ box-sizing: border-box ; --cream : #f2eee3 ; --black : #1b1b1b ; --red : #d91729 ; } html *, html *::before, html *::after { box-sizing: inherit ; } *::before, *::after{ content: "" ; position: absolute ; } body{ margin: 0 ; width: 100% ; height: 100vh ; display: flex ; overflow: hidden ; position: relative ; align-items: center ; justify-content: center ; background-color: var(--cream) ; } .butterfly{ width: 36em; height: 35em; position: relative; background-repeat: no-repeat ; background-image : radial-gradient(circle , var(--red) 46% , transparent 53.2%) , radial-gradient(circle , var(--black) 46% , transparent 53.2%) , radial-gradient(circle at center 0 , transparent 21.9%, var(--black) 22.1% , var(--black) 22.4% , transparent 22.7%) , radial-gradient(circle , var(--red) 30% , var(--black) 32% , var(--black) 51% , transparent 53.2%) , radial-gradient(circle , var(--red) 30% , var(--black) 32% , var(--black) 51% , transparent 53.2%) , radial-gradient(circle , var(--black) 51% , transparent 53.2%), radial-gradient(circle , var(--black) 51% , transparent 53.2%), radial-gradient(circle , var(--cream) 30% , var(--black) 32% , var(--black) 51% , transparent 53.2%) , radial-gradient(circle , var(--cream) 30% , var(--black) 32% , var(--black) 51% , transparent 53.2%) , radial-gradient(circle , var(--cream) 30% , var(--black) 32% , var(--black) 51% , transparent 53.2%) , radial-gradient(circle , var(--cream) 30% , var(--black) 32% , var(--black) 51% , transparent 53.2%) , radial-gradient(circle , var(--red) 30% , var(--black) 32% , var(--black) 51% , transparent 53.2%) , radial-gradient(circle , var(--red) 30% , var(--black) 32% , var(--black) 51% , transparent 53.2%) , radial-gradient(circle , var(--red) 30% , var(--black) 32% , var(--black) 51% , transparent 53.2%) , radial-gradient(circle , var(--red) 30% , var(--black) 32% , var(--black) 51% , transparent 53.2%) , radial-gradient(circle , var(--black) 51% , transparent 53.2%) , radial-gradient(circle , var(--black) 51% , transparent 53.2%) , radial-gradient(circle , var(--black) 51% , transparent 53.2%) , radial-gradient(circle , var(--black) 51% , transparent 53.2%) , radial-gradient(circle at center 0 , var(--cream) 51% , transparent 53.2%) , radial-gradient(circle at center 100% , var(--cream) 51% , transparent 53.2%) , radial-gradient(circle at center 0 , var(--cream) 51% , transparent 53.2%) , radial-gradient(circle at center 100% , var(--cream) 51% , transparent 53.2%) , radial-gradient(circle at center 0 , var(--cream) 51% , transparent 53.2%) , radial-gradient(circle at center 100% , var(--cream) 51% , transparent 53.2%) , radial-gradient(circle at center 0 , var(--cream) 51% , transparent 53.2%) , radial-gradient(circle at center 100% , var(--cream) 51% , transparent 53.2%) , radial-gradient(circle at center 0 , var(--cream) 51% , transparent 53.2%) , radial-gradient(circle at center 100% , var(--cream) 51% , transparent 53.2%) , radial-gradient(circle at center 0 , var(--cream) 51% , transparent 53.2%) , radial-gradient(circle at center 100% , var(--cream) 51% , transparent 53.2%) , radial-gradient(circle at center 0 , var(--cream) 51% , transparent 53.2%) , radial-gradient(circle at center 100% , var(--cream) 51% , transparent 53.2%) , radial-gradient(circle at center 0 , var(--cream) 51% , transparent 53.2%) , radial-gradient(circle at center 100% , var(--cream) 51% , transparent 53.2%) , linear-gradient( var(--black) 100% , transparent 0%) , linear-gradient( var(--black) 100% , transparent 0%) , radial-gradient(circle , var(--black) 46% , transparent 53.2%) , linear-gradient( var(--black) 100% , transparent 0%) ; background-size : 1em 1em , 1em 1em , 17.7em 17.3em , 3em 3em , 3em 3em , 3em 3em , 3em 3em , 3em 3em , 3em 3em , 3em 3em , 3em 3em , 3em 3em , 3em 3em , 3em 3em , 3em 3em , 3em 3em , 3em 3em , 3em 3em , 3em 3em , 2.9em 1.9em , 2.9em 1.9em , 2.9em 1.9em , 2.9em 1.9em , 2.9em 1.9em , 2.9em 1.9em , 2.9em 1.9em , 2.9em 1.9em , 2.9em 1.9em , 2.9em 1.9em , 2.9em 1.9em , 2.9em 1.9em , 2.9em 1.9em , 2.9em 1.9em , 2.9em 1.9em , 2.9em 1.9em , 2.3em .9em , 2.9em .9em , 1em 1em , 0.1em 2.1em ; background-position : 13.12em 5em , 21.62em 5em , 9.02em 5.4em , 15.12em 9.5em , 17.52em 9.5em , 15.12em 11.9em , 17.52em 11.9em , 15.12em 14.2em , 17.52em 14.2em , 15.12em 16.6em , 17.52em 16.6em , 15.12em 19em , 17.52em 19em , 15.12em 21.4em , 17.52em 21.4em , 15.12em 23.8em , 17.52em 23.8em , 15.12em 26.1em , 17.52em 26.1em , 15.2em 11.05em , 17.55em 9em , 15.2em 13.4em , 17.55em 11.5em , 15.2em 15.75em , 17.55em 13.8em , 15.2em 18.2em , 17.55em 16.2em , 15.2em 20.55em , 17.55em 18.6em , 15.2em 22.95em , 17.55em 20.95em , 15.2em 25.35em , 17.55em 23.4em , 15.25em 27.6em , 17.55em 25.7em , 16.7em 27.85em , 16.45em 9.9em , 17.4em 30.6em , 17.8em 28.85em ; } .butterfly::before{ top: 19.25em ; left: 20.9em ; width: 10.3em ; height: 10.3em ; transform: scaleX(-1) ; background-repeat: no-repeat ; border-radius: 50% 0 50% 50% ; background-color: var(--black) ; background-image : radial-gradient(circle , var(--black) 25% , var(--red) 27% , var(--red) 57% , transparent 59%) , radial-gradient(circle , var(--black) 25% , var(--red) 27% , var(--red) 57% , transparent 59%) , radial-gradient(circle , var(--cream) 29% , var(--black) 32% , var(--black) 57% , transparent 59%) , radial-gradient(circle , var(--cream) 29% , var(--black) 32% , var(--black) 57% , transparent 59%) , radial-gradient(circle , var(--cream) 29% , var(--black) 32% , var(--black) 57% , transparent 59%) , radial-gradient(circle , var(--black) 25% , var(--cream) 27% , var(--cream) 58.1% , transparent 60%) , radial-gradient(circle , var(--black) 25% , var(--cream) 27% , var(--cream) 56.6% , transparent 59%) , radial-gradient(circle , var(--black) 25% , var(--cream) 27% , var(--cream) 56.6% , transparent 59%) , radial-gradient(circle , var(--red) 29% , var(--black) 32% , var(--black) 57% , transparent 59%) , radial-gradient(circle at 50.4% 50.5% , var(--cream) 26% , var(--black) 31% , var(--black) 56.6% , transparent 59%) , radial-gradient(circle at 50.4% 50.5% , var(--cream) 26% , var(--black) 31% , var(--black) 56.6% , transparent 59%) , radial-gradient(circle , var(--black) 25% , var(--cream) 27% , var(--cream) 56.6% , transparent 59%) , radial-gradient(circle , var(--black) 25% , var(--cream) 27% , var(--cream) 56.6% , transparent 59%) , radial-gradient(circle , var(--black) 25% , var(--black) 27% , var(--black) 56.6% , transparent 59%) , linear-gradient(var(--cream) 100% , transparent 0) , linear-gradient(var(--cream) 100% , transparent 0) , linear-gradient(var(--cream) 100% , transparent 0) , linear-gradient(var(--cream) 100% , transparent 0) , linear-gradient(var(--red) 100% , transparent 0) ; background-size : 3em 4em , 3em 4em , 3em 4em , 3em 4em , 3em 4em , 3em 4em , 3em 4em , 3em 4em , 3em 4em , 3em 4em , 3em 4em , 3em 4em , 3em 4em , 3em 4em , 3em 1.6em , 3em 1.6em , 3em 1.6em , 3.3em 2.5em , 3em 2.3em ; background-position : 1.6em -1.05em , -1.2em 1.8em , 4.5em -1.1em , 1.7em 1.8em , -1.2em 4.7em , 7.45em -1.05em , 4.55em 1.8em , 1.7em 4.7em .........完整代码请登录后点击上方下载按钮下载查看
网友评论0