Skip to content

Commit 1a3cc79

Browse files
committed
手机端居中,删除页脚
1 parent 24592b8 commit 1a3cc79

2 files changed

Lines changed: 8 additions & 10 deletions

File tree

‎_layouts/default.html‎

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,7 @@ <h1 class="ty-blog-sidebar__title">
5959
<div class="ty-blog-content">
6060
<!-- 文章内容(不变) -->
6161
{{ content }}
62-
63-
<!-- 页脚:移到内容区内,添加精准类名 ty-blog-footer(优化位置,跟随文章底部) -->
64-
<footer class="ty-blog-footer">
65-
{% if site.github.is_project_page %}
66-
<p>This project is maintained by <a href="{{ site.github.owner_url }}">{{ site.github.owner_name }}</a></p>
67-
{% endif %}
68-
<p>&copy; {{ site.time | date: "%Y" }} {{ site.title | default: site.github.repository_name }}</p> <!-- 新增版权信息,更完整(可选) -->
69-
</footer>
62+
7063
</div>
7164
</div>
7265
<script src="{{ "/assets/js/scale.fix.js" | relative_url }}"></script>

‎assets/css/custom-layout.css‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,11 @@
5353
color: var(--color-text, #333); /* 文字颜色使用 CSS 变量,兼容深色模式 */
5454
text-decoration: none; /* 去除链接默认下划线(可选,保持主题风格) */
5555
/* 修复:强制居中,覆盖主题默认的左对齐 */
56-
text-align: center;
56+
text-align: center !important;
5757
display: inline-block;
58+
padding: 0;
59+
margin-left: auto;
60+
margin-right: auto;
5861
}
5962

6063
/* 新增:覆盖侧边栏链接内的 <strong> 标签样式,解决深色模式下不是白色的问题 */
@@ -80,8 +83,10 @@
8083
padding: 0; /* 去除默认内边距 */
8184
margin: 20px 0 0; /* 顶部间距,和上方内容分隔 */
8285
/* 修复:列表整体居中 */
83-
text-align: center;
86+
text-align: center !important;
8487
width: 100%;
88+
margin-left: auto;
89+
margin-right: auto;
8590
}
8691

8792
.ty-blog-sidebar__downloads li {

0 commit comments

Comments
 (0)