经验首页 前端设计 程序设计 Java相关 移动开发 数据库/运维 软件/图像 大数据/云计算 其他经验
当前位置:技术经验 » HTML/CSS » CSS3 » 查看文章
CSS3实现的文字弹出特效_css3_CSS
来源:jb51  时间:2021/4/19 8:39:40  对本文有异议

实现效果

实现代码

html

  1. <div>w3xue</div>
  2. <div>
  3. <span>https://www.jb51.net</span>
  4. </div>
  5.  
  6.  
  7. <p>a css3 animation demo</p>

css3

  1. @import url('https://fonts.googleapis.com/css?family=Roboto:300');
  2.  
  3. body {
  4. text-align:center;
  5. background:linear-gradient(141deg, #ccc 25%, #eee 40%, #ddd 55%);
  6. color:#555;
  7. font-family:'Roboto';
  8. font-weight:300;
  9. font-size:32px;
  10. padding-top:40vh;
  11. height:100vh;
  12. overflow:hidden;
  13. -webkit-backface-visibility: hidden;
  14. -webkit-perspective: 1000;
  15. -webkit-transform: translate3d(0,0,0);
  16. }
  17.  
  18. div {
  19. display:inline-block;
  20. overflow:hidden;
  21. white-space:nowrap;
  22. }
  23.  
  24. div:first-of-type { /* For increasing performance
  25. ID/Class should've been used.
  26. For a small demo
  27. it's okaish for now */
  28. animation: showup 7s infinite;
  29. }
  30.  
  31. div:last-of-type {
  32. width:0px;
  33. animation: reveal 7s infinite;
  34. }
  35.  
  36. div:last-of-type span {
  37. margin-left:-355px;
  38. animation: slidein 7s infinite;
  39. }
  40.  
  41. @keyframes showup {
  42. 0% {opacity:0;}
  43. 20% {opacity:1;}
  44. 80% {opacity:1;}
  45. 100% {opacity:0;}
  46. }
  47.  
  48. @keyframes slidein {
  49. 0% { margin-left:-800px; }
  50. 20% { margin-left:-800px; }
  51. 35% { margin-left:0px; }
  52. 100% { margin-left:0px; }
  53. }
  54.  
  55. @keyframes reveal {
  56. 0% {opacity:0;width:0px;}
  57. 20% {opacity:1;width:0px;}
  58. 30% {width:355px;}
  59. 80% {opacity:1;}
  60. 100% {opacity:0;width:355px;}
  61. }
  62.  
  63.  
  64. p {
  65. font-size:12px;
  66. color:#999;
  67. margin-top:200px;
  68. }

以上就是CSS3实现的文字弹出特效的详细内容,更多关于CSS3 文字弹出特效的资料请关注w3xue其它相关文章!

 友情链接:直通硅谷  点职佳  北美留学生论坛

本站QQ群:前端 618073944 | Java 606181507 | Python 626812652 | C/C++ 612253063 | 微信 634508462 | 苹果 692586424 | C#/.net 182808419 | PHP 305140648 | 运维 608723728

W3xue 的所有内容仅供测试,对任何法律问题及风险不承担任何责任。通过使用本站内容随之而来的风险与本站无关。
关于我们  |  意见建议  |  捐助我们  |  报错有奖  |  广告合作、友情链接(目前9元/月)请联系QQ:27243702 沸活量
皖ICP备17017327号-2 皖公网安备34020702000426号