Skip to content

Commit 3908152

Browse files
committed
fix: resolve layout issues with CSS and HTML structure
Major layout fixes: - Replace conflicting .wrapper class with .container - Fix flexbox layout to prevent footer overlap - Ensure proper sticky positioning for sidebar - Add margin-top: auto to footer for proper placement - Clean up CSS structure for better maintainability Files changed: - assets/css/style.css: Complete rewrite with fixed layout - _layouts/default.html: Change wrapper to container class
1 parent 86e5b73 commit 3908152

2 files changed

Lines changed: 22 additions & 16 deletions

File tree

_layouts/default.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,17 @@
1111
</head>
1212
<body>
1313
<header class="site-header">
14-
<div class="wrapper">
14+
<div class="container">
1515
<a class="site-title" href="{{ '/' | relative_url }}">{{ site.title }}</a>
1616
<nav class="site-nav">
1717
<a href="{{ '/docs/zh_CN/' | relative_url }}" class="nav-link">中文</a>
1818
<a href="{{ '/docs/en_US/' | relative_url }}" class="nav-link">English</a>
1919
</nav>
2020
</div>
2121
</header>
22-
22+
2323
<main class="page-content">
24-
<div class="wrapper">
24+
<div class="container">
2525
<div class="sidebar">
2626
{% include sidebar.html %}
2727
</div>
@@ -35,9 +35,9 @@
3535
</article>
3636
</div>
3737
</main>
38-
38+
3939
<footer class="site-footer">
40-
<div class="wrapper">
40+
<div class="container">
4141
<p>&copy; {{ site.time | date: '%Y' }} ModelEngine-Group. All rights reserved.</p>
4242
</div>
4343
</footer>

assets/css/style.css

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,12 @@ body {
1818
flex-direction: column;
1919
}
2020

21-
.wrapper {
21+
/* Container for header and footer */
22+
.container {
2223
max-width: 1200px;
2324
width: 100%;
2425
margin: 0 auto;
2526
padding: 0 16px;
26-
flex: 1;
27-
display: flex;
28-
flex-direction: column;
2927
}
3028

3129
.site-header {
@@ -35,6 +33,12 @@ body {
3533
flex-shrink: 0;
3634
}
3735

36+
.site-header .container {
37+
display: flex;
38+
justify-content: space-between;
39+
align-items: center;
40+
}
41+
3842
.site-title {
3943
color: #fff;
4044
font-size: 1.5rem;
@@ -43,13 +47,13 @@ body {
4347
}
4448

4549
.site-nav {
46-
float: right;
50+
display: flex;
51+
gap: 16px;
4752
}
4853

4954
.nav-link {
5055
color: rgba(255,255,255,0.7);
5156
text-decoration: none;
52-
margin-left: 16px;
5357
padding: 4px 8px;
5458
border-radius: 4px;
5559
}
@@ -60,12 +64,11 @@ body {
6064
}
6165

6266
.page-content {
63-
padding: 32px 0;
6467
flex: 1;
65-
min-height: calc(100vh - 200px);
68+
padding: 32px 0;
6669
}
6770

68-
.page-content .wrapper {
71+
.page-content .container {
6972
display: flex;
7073
gap: 32px;
7174
align-items: flex-start;
@@ -169,6 +172,7 @@ body {
169172
padding: 24px 0;
170173
text-align: center;
171174
flex-shrink: 0;
175+
margin-top: auto;
172176
}
173177

174178
.site-footer p {
@@ -203,11 +207,13 @@ body {
203207
}
204208

205209
@media (max-width: 768px) {
206-
.page-content .wrapper {
210+
.page-content .container {
207211
flex-direction: column;
208212
}
209-
213+
210214
.sidebar {
211215
width: 100%;
216+
position: static;
217+
max-height: none;
212218
}
213219
}

0 commit comments

Comments
 (0)