日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 前端技术 > HTML >内容正文

HTML

HTML+CSS制作DNA双螺旋结构

發布時間:2024/3/12 HTML 34 豆豆
生活随笔 收集整理的這篇文章主要介紹了 HTML+CSS制作DNA双螺旋结构 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

HTML+CSS制作DNA雙螺旋結構
效果圖如下:

HTML部分源代碼如下:

<!DOCTYPE html> <html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>雙螺旋結構</title><link rel="stylesheet" href="style.css"> </head><body><div class="item"><div class="line"></div></div><div class="item"><div class="line"></div></div><div class="item"><div class="line"></div></div><div class="item"><div class="line"></div></div><div class="item"><div class="line"></div></div><div class="item"><div class="line"></div></div><div class="item"><div class="line"></div></div><div class="item"><div class="line"></div></div><div class="item"><div class="line"></div></div><div class="item"><div class="line"></div></div> </body></html>

CSS部分源代碼如下:

:root {--background-color: #2c3e50;--line-color: slategray; }* {margin: 0;padding: 0; }body {width: 100vw;height: 100vh;background-color: var(--background-color);display: flex;justify-content: center;align-items: center;flex-direction: column; }.item {position: relative;width: 120px;height: 40px;display: flex;justify-content: center;align-items: center;/* background-color: cadetblue; */ }.item .line {width: 120px;height: 3px;background-color: var(--line-color);animation: line_width_change 1s linear infinite; }@keyframes line_width_change {0%, 100% {width: 100%;}50% {width: 0%;} }.item::before, .item::after {position: absolute;content: "";width: 30px;height: 30px;border-radius: 50%;background-color: yellow; }.item::before {background-color: salmon;left: -15px;animation: circle_move1 2s linear infinite;z-index: 100; }.item::after {background-color: seagreen;right: -15px;animation: circle_move2 2s linear infinite;z-index: 200; }@keyframes circle_move1 {0% {left: -15px;width: 30px;height: 30px;z-index: 100;}25% {width: 25px;height: 25px;}50% {left: 105px;width: 30px;height: 30px;}75% {width: 35px;height: 35px;}100% {left: -15px;width: 30px;height: 30px;z-index: 200;} }@keyframes circle_move2 {0% {right: -15px;width: 30px;height: 30px;z-index: 200;}25% {width: 35px;height: 35px;}50% {right: 105px;width: 30px;height: 30px;}75% {width: 25px;height: 25px;}100% {right: -15px;width: 30px;height: 30px;z-index: 100;} }.item:nth-child(1) .line, .item:nth-child(1)::before, .item:nth-child(1)::after {animation-delay: 0.1s; } .item:nth-child(2) .line, .item:nth-child(2)::before, .item:nth-child(2)::after {animation-delay: 0.2s; } .item:nth-child(3) .line, .item:nth-child(3)::before, .item:nth-child(3)::after {animation-delay: 0.3s; } .item:nth-child(4) .line, .item:nth-child(4)::before, .item:nth-child(4)::after {animation-delay: 0.4s; } .item:nth-child(5) .line, .item:nth-child(5)::before, .item:nth-child(5)::after {animation-delay: 0.5s; } .item:nth-child(6) .line, .item:nth-child(6)::before, .item:nth-child(6)::after {animation-delay: 0.6s; } .item:nth-child(7) .line, .item:nth-child(7)::before, .item:nth-child(7)::after {animation-delay: 0.7s; } .item:nth-child(8) .line, .item:nth-child(8)::before, .item:nth-child(8)::after {animation-delay: 0.8s; } .item:nth-child(9) .line, .item:nth-child(9)::before, .item:nth-child(9)::after {animation-delay: 0.9s; } .item:nth-child(10) .line, .item:nth-child(10)::before, .item:nth-child(10)::after {animation-delay: 1s; }

總結

以上是生活随笔為你收集整理的HTML+CSS制作DNA双螺旋结构的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。