
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>圆角炫彩滚动公告</title>
<style>
/* 公告容器 —— 添加圆角 */
.rainbow-notice {
background-color: #000;
padding: 12px 0;
overflow: hidden;
white-space: nowrap;
position: relative;
font-family: "Microsoft YaHei", sans-serif;
box-shadow: 0 2px 10px rgba(0,0,0,0.5);
border-radius: 12px; /* 👈 关键:添加圆角 */
margin: 10px auto; /* 可选:居中并留点外边距 */
max-width: 90%; /* 防止在小屏上贴边 */
}
/* 滚动内容 */
.notice-content {
display: inline-block;
animation: scroll-left 20s linear infinite;
padding-left: 100%;
}
/* 炫彩文字效果 */
.rainbow-text {
background: linear-gradient(
to right,
#ff0000, #ff8000, #ffff00, #80ff00,
#00ff80, #00ffff, #0080ff, #8000ff,
#ff00ff, #ff0080, #ff0000
);
background-size: 300% 100%;
-webkit-background-clip: text;
background-clip: text;
color: transparent;
animation: rainbow 4s linear infinite;
font-weight: bold;
font-size: 16px;
letter-spacing: 1px;
}
/* 滚动动画 */
@keyframes scroll-left {
0% { transform: translateX(0); }
100% { transform: translateX(-100%); }
}
/* 炫彩动画 */
@keyframes rainbow {
0% { background-position: 0% 50%; }
100% { background-position: 300% 50%; }
}
/* 移动端适配 */
@media (max-width: 768px) {
.rainbow-notice {
border-radius: 8px; /* 小屏稍小一点的圆角 */
padding: 10px 0;
}
.rainbow-text {
font-size: 14px;
}
}
</style>
</head>
<body style="background: #f0f0f0; padding: 20px; margin: 0;">
<!-- 圆角滚动公告 -->
<div class="rainbow-notice">
<div class="notice-content">
<span class="rainbow-text">🎉 欢迎访问白川子比官方贴</span>
</div>
</div>
</body>
</html>
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END



























暂无评论内容