Skip to content

Commit df84717

Browse files
committed
fix(layout): 彻底修复导航栏高度问题,固定导航栏高度
1 parent 3ac31a8 commit df84717

File tree

2 files changed

+19
-11
lines changed

2 files changed

+19
-11
lines changed

script-hook-website/src/components/Header.css

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,26 @@
44
left: 0;
55
right: 0;
66
background-color: #ffffff;
7-
padding: 20px 0;
7+
padding: 5px 0;
8+
height: 50px;
9+
display: flex;
10+
align-items: center;
811
transition: all 0.3s ease;
912
z-index: 1000;
1013
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
1114
}
1215

1316
.header.scrolled {
14-
padding: 12px 0;
17+
padding: 3px 0;
18+
height: 40px;
1519
}
1620

1721
.header-container {
1822
display: flex;
1923
align-items: center;
2024
justify-content: space-between;
2125
padding: 0 15px;
26+
height: 100%;
2227
position: relative;
2328
width: 100%;
2429
}
@@ -34,15 +39,15 @@
3439
}
3540

3641
.site-logo {
37-
height: 36px;
38-
margin-right: 10px;
42+
height: 30px;
43+
margin-right: 8px;
3944
transition: all 0.3s ease;
4045
background-color: transparent;
4146
mix-blend-mode: multiply;
4247
}
4348

4449
.header.scrolled .site-logo {
45-
height: 30px;
50+
height: 24px;
4651
}
4752

4853
.site-name {
@@ -70,10 +75,10 @@
7075
}
7176

7277
.main-nav a {
73-
font-size: 16px;
78+
font-size: 14px;
7479
font-weight: 500;
7580
position: relative;
76-
padding-bottom: 5px;
81+
padding-bottom: 3px;
7782
color: #333;
7883
text-decoration: none;
7984
transition: color 0.3s;

script-hook-website/src/components/Hero.css

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
.hero {
2-
padding: 60px 0 80px;
3-
margin-top: -20px;
2+
padding-top: 50px;
3+
padding-bottom: 80px;
4+
margin-top: 0;
45
background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
56
position: relative;
67
overflow: hidden;
8+
box-sizing: border-box;
79
}
810

911
.hero .container {
@@ -123,8 +125,9 @@ h1 {
123125

124126
@media (max-width: 992px) {
125127
.hero {
126-
padding: 60px 0 60px;
127-
margin-top: -15px;
128+
padding-top: 45px;
129+
padding-bottom: 60px;
130+
margin-top: 0;
128131
}
129132

130133
.hero .container {

0 commit comments

Comments
 (0)