Skip to content

Commit b95c7fc

Browse files
committed
update
1 parent 387b0ab commit b95c7fc

File tree

1 file changed

+67
-0
lines changed

1 file changed

+67
-0
lines changed

assets/css/style.css

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -849,3 +849,70 @@ h1, h2, h3, p, li, .caption, .small {
849849
.caption { font-size: 12px; }
850850
canvas.chart { height: 250px !important; }
851851
}
852+
853+
854+
/* ===== Mobile carousel centering fix ===== */
855+
@media (max-width: 768px) {
856+
.carousel-container{
857+
max-width: 100%;
858+
margin: 16px auto;
859+
padding: 8px 0 44px; /* 底部给 caption 留空间 */
860+
overflow: visible;
861+
}
862+
863+
.carousel-window{
864+
width: 100%;
865+
overflow: hidden;
866+
-webkit-mask-image: none !important;
867+
mask-image: none !important;
868+
}
869+
870+
.carousel-track{
871+
display: flex;
872+
align-items: center;
873+
justify-content: center; /* 关键:轨道内容居中 */
874+
gap: 0; /* 关键:去掉间隔避免偏移 */
875+
padding: 0;
876+
transform: none !important; /* 若 JS/旧样式有 transform,先压住 */
877+
}
878+
879+
.carousel-card{
880+
flex: 0 0 100%;
881+
max-width: 100%;
882+
width: 100%;
883+
margin: 0 auto;
884+
opacity: 0;
885+
transform: none !important;
886+
filter: none !important;
887+
transition: opacity .25s ease;
888+
}
889+
890+
.carousel-card.is-active{
891+
opacity: 1;
892+
z-index: 2;
893+
}
894+
895+
.video-wrapper{
896+
width: 100%;
897+
margin: 0 auto;
898+
border-radius: 12px;
899+
}
900+
901+
/* 只显示当前卡片标题,且居中 */
902+
.carousel-card .caption{
903+
text-align: center;
904+
margin-top: 10px;
905+
font-size: 15px;
906+
line-height: 1.35;
907+
}
908+
909+
/* 按钮垂直居中到视频中线,并贴边 */
910+
.nav-btn{
911+
top: calc(50% - 22px); /* 对齐视频视觉中心 */
912+
width: 42px;
913+
height: 42px;
914+
z-index: 5;
915+
}
916+
.prev-btn{ left: 8px; }
917+
.next-btn{ right: 8px; }
918+
}

0 commit comments

Comments
 (0)