Main Page/styles.css: Difference between revisions
Jump to navigation
Jump to search
Selfice changed the content model of the page Main Page/styles.css from "CSS" to "Sanitized CSS" Tag: content model change |
No edit summary |
||
Line 2: | Line 2: | ||
font-size:1.6em; | font-size:1.6em; | ||
font-weight: bold; | font-weight: bold; | ||
} | |||
.scrolling-text { | |||
overflow: hidden; /* 隐藏溢出的内容 */ | |||
height: 50px; /* 设置固定高度以限制滚动区域 */ | |||
border: 1px solid #000; /* 为清晰起见添加边框 */ | |||
position: relative; /* 设置相对定位 */ | |||
} | |||
.scrolling-text span { | |||
display: inline-block; | |||
position: absolute; /* 绝对定位以实现移动效果 */ | |||
top: -100%; /* 从容器顶部开始 */ | |||
animation: scroll-text 5s linear infinite; /* 定义动画 */ | |||
} | |||
@keyframes scroll-text { | |||
0% { | |||
top: -100%; /* 从容器顶部开始 */ | |||
} | |||
100% { | |||
top: 100%; /* 向下滚动到容器底部 */ | |||
} | |||
} | } |
Revision as of 23:30, 24 October 2024
.mainpage-title{ font-size:1.6em; font-weight: bold; } .scrolling-text { overflow: hidden; /* 隐藏溢出的内容 */ height: 50px; /* 设置固定高度以限制滚动区域 */ border: 1px solid #000; /* 为清晰起见添加边框 */ position: relative; /* 设置相对定位 */ } .scrolling-text span { display: inline-block; position: absolute; /* 绝对定位以实现移动效果 */ top: -100%; /* 从容器顶部开始 */ animation: scroll-text 5s linear infinite; /* 定义动画 */ } @keyframes scroll-text { 0% { top: -100%; /* 从容器顶部开始 */ } 100% { top: 100%; /* 向下滚动到容器底部 */ } }