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双螺旋结构相关推荐

  1. 纯CSS制作的图形效果

    纯CSS制作的图形效果 很少会有人意识到,当浏览器绘制的border,会有一个角度的问题.我们就是得用这样的一个技巧来制作三角的效果.我们只需要保证一边的边框是有色,其他边框色为透明色,这样我们就很容 ...

  2. 如何用CSS制作横向菜单?

    管在我的网站和文章里都有提到CSS制作菜单的方法,但很多初学者还是不太清楚如何实现,以及实现原理,我想专门写一篇详细教程会对大家比较有帮助. 我们先来看一个菜单的例子,最终效果是: 首页 产品介绍 服 ...

  3. html语言制作留言条,利用DIV+CSS制作右下角弹出留言板

    /p> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 利用DIV+CSS制作右下角弹出留言板 a ...

  4. html中多边形图形怎么制作,CSS制作图形速查表

    前面在<纯CSS制作的图形效果>一文中介绍了十六种CSS画各种不同图形的方法.今天花了点时间将这方面的制作成一份清单,方便大家急用时有地方可查.别的不多说了,直接看代码. 为了节省时间,下 ...

  5. css制作漂亮彩带导航条菜单

    点击这里查看效果: http://keleyi.com/keleyi/phtml/divcss/17.htm 效果图: 以下是源代码: 1 <!DOCTYPE html PUBLIC " ...

  6. html把div分成两栏,div+css制作上中下,中间两列的全屏自适应布局

    制作自适应布局的网页对初学者是个难点,今天我们以最常见的上中下结构,中间又分为两列的全屏自适应布局为例,教大家如何制作自适应布局网页. 上中下结构,中间又分为两列的全屏自适应布局HTML代码: 上中下 ...

  7. 使用css制作三角,兼容IE6,用到的标签divsspan

    使用css来制作三角,在日常用得较多.恰好这几天项目中有用到,之前只是从网上copy下来代码直接用,但是今天在用的时候遇到一些问题,于是借此机会把这个css绘制三角好好研究下吧. 我们分别写一个< ...

  8. table虚线边框_web前端工程师7天0基础到精通(TABLE+CSS制作《互联世纪网》)

    项目七 项目实践:TABLE+CSS制作<互联世纪网> 实践目标 1. 熟悉CSS属性 2. 熟练运用CSS属性控制网页样式 3. 熟悉网页制作流程 项目简介: 通过上一章节的学习,我们了 ...

  9. html css做网页总结,学习CSS制作网页总结的一些经验

    学习CSS制作网页总结的一些经验 互联网   发布时间:2008-10-17 19:28:20   作者:佚名   我要评论 让你使用DIV CSS排版 不是让你用换个标签然后再去按照表格的方式去排版 ...

最新文章

  1. Spring 整合 Junit
  2. Hadoop新手篇:hadoop入门基础教程
  3. python常用的包_Python3之常用包汇总
  4. Visual Studio Team System 2008 Team Suite (90-day Trial)(转)
  5. 教你如何判断水泥的质量好坏?
  6. TCP/IP之路由算法
  7. [VNC] VNC Viewer 远程运行 ffplay 出现错误 GLXBadRenderRequest
  8. 第二季-专题13-NandFlash变硬盘
  9. 大神级ppt作品欣赏_超写实绘画,逼真到让你怀疑自己的双眼,各路超写实大神作品欣赏...
  10. 视频转rtmp流及搭建视频流服务器
  11. 网易面试题,小易沉迷游戏
  12. 小技巧|H5禁止手机虚拟键盘弹出
  13. mac 查看 本地网络代理
  14. 北京的“狗不理”包子与傻X
  15. php调用shell执行scp,使用shell脚本自动执行scp文件传输
  16. 在线sql进行Excel表格拆分
  17. 图像mnf正变换_基于MNF 变换的多元变化检测变化信息的集中
  18. c++编程 设置桌面壁纸以及设置壁纸失效的解决办法
  19. 多项式(带余)除法学习笔记
  20. DBSCAN聚类算法原理及图解

热门文章

  1. LDO参数解读、特性、参考设计
  2. 无功控制器电容投切方案整理
  3. android的输出流和剪裁python实现以下原理
  4. 十大老牌黑客之:米特尼克
  5. Python核心编程-Amy老师第十讲课程作业
  6. amoled led 排列_AMOLED的PWM调光和LCD蓝光,哪个比较伤眼?
  7. AI幼儿园教育火了,人人都是深度学习界的明日之星?
  8. 真假博士后事件 万万没想到这些明星是学霸
  9. 如何在自己电脑上配置开发深度学习项目(windows)
  10. java字符串加密解密工具类