Skip to content

Commit 431a4df

Browse files
committed
移动端样式优化
1 parent c450923 commit 431a4df

File tree

2 files changed

+27
-4
lines changed

2 files changed

+27
-4
lines changed

src/components/TitileCard.astro

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,4 +78,20 @@ const { title, date, wordNum, description } = Astro.props;
7878
.word-num {
7979
flex: 0; /* 保持宽度 */
8080
}
81+
82+
@media (max-width: 768px) {
83+
html {
84+
font-size: 14px;
85+
}
86+
.post-card {
87+
gap: 0.3rem;
88+
height: 6.5rem;
89+
margin: 4px 0;
90+
max-weight: 95vw;
91+
border-radius: 5px;
92+
}
93+
.card-top {
94+
margin-bottom: -5px;
95+
}
96+
}
8197
</style>

src/pages/blog/[page].astro

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,6 @@ const readTimeMin = Math.ceil(fontNum / MIN_READ_COUNT);
7676
font-style: normal;
7777
}
7878

79-
.title {
80-
white-space: nowrap; /* 不换行 */
81-
}
82-
8379
.blog-head {
8480
}
8581

@@ -113,4 +109,15 @@ const readTimeMin = Math.ceil(fontNum / MIN_READ_COUNT);
113109
#text {
114110
margin: 3.5rem 0;
115111
}
112+
113+
@media (max-width: 768px) {
114+
.title {
115+
font-size: 1.5rem;
116+
}
117+
.description {
118+
font-size: 1rem;
119+
line-height: 0.8rem;
120+
margin: 1rem 0;
121+
}
122+
}
116123
</style>

0 commit comments

Comments
 (0)