首页 > 其他分享 >用CSS一分钟写出打字动画

用CSS一分钟写出打字动画

时间:2023-04-06 17:46:40浏览次数:38  
标签:box 动画 center 打字 keyframes blink width border CSS

HTML

<div>没有空白的人生,永远都不会有心灵的宁静和精神的愉悦。</div>
CSS3

* { margin: 0; padding: 0; box-sizing: border-box; } body { text-align: center; display: flex; justify-content: center; align-items: center; } div { width: 390px; animation: typing 2s steps(26),blink .5s step-end infinite; white-space: nowrap; overflow: hidden; border-right: 3px solid; font-size: 15px; margin:300px auto; } @keyframes typing { from { width: 0; } } @keyframes blink { 50% { border-color: transparent; } }

  

标签:box,动画,center,打字,keyframes,blink,width,border,CSS
From: https://www.cnblogs.com/zy-mg/p/17293562.html

相关文章

  • 核心动画
    1.无缝动画-(void)awakeFromNib{iphone每秒刷新60次,屏幕刷新的时候就会触发CADisplayLink*link=[CADisplayLinkdisplayLinkWithTarget:selfselector:@selector(setNeedsDisplay)];[linkaddToRunLoop:[NSRunLoopmainRunLoop]forMode:NSRunLoopCommonM......
  • 实现和CSS一样的easing动画?直接看Mozilla、Chromium源码!
    前言在上一篇丝滑的贝塞尔曲线:从数学原理到应用介绍贝塞尔曲线实现动画时给自己留了一个坑,实现的动画效果和CSS的transition-timing-function:cubic-bezier差别较大,如下图所示,红色为Linear、绿色为CSS的cubic-beizer、蓝色为自己实现的cbezier。本着有坑必填的原则,直接把Mozilla......
  • Insert a scratch project into a ppt (MSPowerPoinT file)在powerpoint中播放Scratch
    Insertascratchprojectintoappt(MSPowerPoinTfile)在powerpoint中播放Scratch动画Contributedbyliupeng,March01,20120Comments4BookmarksAsupersimplewaytoinsertasbtoappt,asfollows:超级简单的实现Scratch的sb文件在ppt中播放,具体......
  • css自定义复选框和单选框
    <!DOCTYPEhtml><html><head><metacharset="UTF-8"><title></title></head><styletype="text/css">*{margin:0;padding:0;box-sizing:border-box;}......
  • React的行内样式与CSS
    如何为组件添加CSS的class?传递一个字符串作为className属性:render(){return<spanclassName="menunavigation-menu">Menu</span>}CSS的class依赖组件的props或state的情况很常见:render(){letclassName='menu';if(this.props.isActive)......
  • CSS笔记(待完善)
    CSS笔记css权重ID(100)>class(10)>element(1)css最高权重!important块元素(block)可以设置宽度和高度,独立成行。h1~h6、p、div、ul、li行内元素(内联元素、块级元素)(inline)不可以设置宽度和高度,不独立成行a、span行内块元素(inline-block)可以设置宽度和高度,不独立......
  • python-爬虫-css提取-写入csv-爬取猫眼电影榜单
    猫眼有一个电影榜单top100,我们将他的榜单电影数据(电影名、主演、上映时间、豆瓣评分)抓下来保存到本地的excle中本案例使用css方式提取页面数据,所以会用到以下库importtimeimportrequestsimportparsel#解析库,解析cssimportcsv#爬取的数据写入csv创建csv文件标头信息......
  • 前端开发-CSS
    三种CSS写法1.在标签内书写2.在head中书写3.在外部文件书写 各种选择器常用:类选择器,标签选择器,后代选择器少用:ID选择器,属性选择器    多个样式覆盖问题:1.样式不同时一起作用2.样式相同时,取style中排序后面的3.若要强制使用,则添加important,如color:red!imp......
  • 第四十六篇 vue - 进阶主题 - 动画技巧
    动画技巧Vue提供了<Transition>和<TransitionGroup>组件来处理元素进入、离开和列表顺序变化的过渡效果。但除此之外,还有许多其他制作网页动画的方式在Vue应用中也适用。这里我们会探讨一些额外的技巧基于CSSclass的动画对于那些不是正在进入或离开DOM的元素,我们可......
  • js 修改当前的css
    CSSStyleSheet.insertRule()CSSStyleSheet.insertRule(".red::before{color:lightgray;content:"测试"}",0)CSSStyleSheet.addRule()已经移除废弃stylesheet.deleteRule(index)CSSStyleSheet.replace()详情见官网https://developer.mozilla.org/......