纯css滚动公告栏目

<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title></title> <style type="text/css"> .wrap { height: 30px; overflow: hidden; position: absolute; top: 30; left: 100; width: 100% } p { margin: 0; height: 30px; line-height: 30px; text-align: center; background: #ccc; width: 300px; } .content p { position: absolute; } @-webkit-keyframes anim1 { 0% { top: 40px; opacity: 1 } 50% { top: -40px; opacity: 1 } 75% { top: -40px; opacity: 0 } 100% { top: 40px; opacity: 0 } } @-webkit-keyframes anim2 { 0% { top: -40px; opacity: 0 } 25% { top: 40px; opacity: 0 } 50% { top: 40px; opacity: 1 } 100% { top: -40px; opacity: 1 } } .content p:nth-child(1) { -webkit-animation: anim1 5s linear infinite; } .content p:nth-child(2) { -webkit-animation: anim2 5s linear infinite; } </style> </head> <body> <div class="wrap"> <div class="content"> <p>第一条消息</p> <p>第二条消息</p> </div> </div> </body> </html>

 


__EOF__

本文作者蓝色帅-橙子哥
本文链接https://www.cnblogs.com/lhl66/p/9094492.html
关于博主:评论和私信会在第一时间回复。或者直接私信我。
版权声明:本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!
声援博主:如果您觉得文章对您有帮助,可以点击文章右下角推荐一下。您的鼓励是博主的最大动力!
posted @   鱼樱前端  阅读(4047)  评论(1编辑  收藏  举报
编辑推荐:
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
阅读排行:
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 地球OL攻略 —— 某应届生求职总结
· 提示词工程——AI应用必不可少的技术
· Open-Sora 2.0 重磅开源!
· 周边上新:园子的第一款马克杯温暖上架
 
往后余生 - 王贰浪
00:00 / 00:00
An audio error has occurred, player will skip forward in 2 seconds.
  1. 1 往后余生 王贰浪
  2. 2 拂雪 不才
  3. 3 我的一个道姑朋友 洛尘鞅
  4. 4 大田后生仔 王雨萌
点击右上角即可分享
微信分享提示