<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>滚动通知</title>
<style>
/* 更新提醒 */
.updateRemindWrap {
background-color: #FCF6ED;
color: #EEB154;
height: 40px;
display: flex;
align-items: center;
margin-bottom: 16px;
padding: 0 6px 0 12px;
font-size: 14px;
border-radius: 4px;
}
.updateRemindWrap .iconfont {
font-size: 20px;
}
.updateRemindWrap .newsIcon {
margin-right: 10px;
}
.updateRemindWrap .updateTextWrap {
width: 82%;
height: 100%;
position: relative;
overflow: hidden;
}
.updateRemindWrap .updateText {
height: 100%;
line-height: 40px;
white-space: nowrap;
position: absolute;
top: 0;
left: 0;
animation: 10s wordsLoop linear infinite normal;
}
.updateRemindWrap .lookMOre {
margin-left: auto;
}
@keyframes wordsLoop {
0% {
transform: translateX(200px);
-webkit-transform: translateX(200px);
}
100% {
transform: translateX(-100%);
-webkit-transform: translateX(-100%);
}
}
@-webkit-keyframes wordsLoop {
0% {
transform: translateX(200px);
-webkit-transform: translateX(200px);
}
100% {
transform: translateX(-100%);
-webkit-transform: translateX(-100%);
}
}
</style>
</head>
<body>
<!-- 更新提醒 -->
<div class="updateRemindWrap" id="update">
<span class="iconfont icon-xiaoxi newsIcon"></span>
<div class="updateTextWrap">
<span class="updateText">有新版本了,请点击打开应用商店在更新列表中更新。</span>
</div>
<span class="iconfont icon-chakangengduo lookMOre"></span>
</div>
</body>
</html>
css3实现消息提示的滚动播放
猜你喜欢
转载自blog.csdn.net/Serena_tz/article/details/130525392
今日推荐
周排行