Main Page/styles.css: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 6: | Line 6: | ||
position: relative; | position: relative; | ||
width: 100%; /* 可以根据需要调整 */ | width: 100%; /* 可以根据需要调整 */ | ||
height: | height: 64px; /* 可以根据需要调整 */ | ||
margin: 0 auto; /* 居中对齐 */ | margin: 0 auto; /* 居中对齐 */ | ||
overflow: hidden; | overflow: hidden; |
Revision as of 01:00, 25 October 2024
.mainpage-title{ font-size:1.6em; font-weight: bold; } .text-container { position: relative; width: 100%; /* 可以根据需要调整 */ height: 64px; /* 可以根据需要调整 */ margin: 0 auto; /* 居中对齐 */ overflow: hidden; } .text-slide { position: absolute; width: 100%; height: 100%; top: 0; left: 0; opacity: 0; animation: slide-animation 6s infinite; } .text-slide:nth-child(1) { animation-delay: 0s; } .text-slide:nth-child(2) { animation-delay: 2s; } .text-slide:nth-child(3) { animation-delay: 4s; } @keyframes slide-animation { 0%, 20% { opacity: 0; transform: translateX(0); } 25%, 45% { opacity: 1; transform: translateX(-1px); } 30%, 40% { transform: translateX(1px); } 50%, 100% { opacity: 0; transform: translateX(0); } }