diff --git a/src/assets/styles/global.css b/src/assets/styles/global.css index 019eaf2..cef9b91 100644 --- a/src/assets/styles/global.css +++ b/src/assets/styles/global.css @@ -47,6 +47,7 @@ body { font-family: 'LXGW WenKai', sans-serif; margin: 0; padding: 0; + padding-top: 60px; } /* 设置代码或等宽文本的字体 */ diff --git a/src/components/NavBar.vue b/src/components/NavBar.vue index 8b7c547..801c245 100644 --- a/src/components/NavBar.vue +++ b/src/components/NavBar.vue @@ -131,6 +131,13 @@ initializeDarkMode(); align-items: center; justify-content: space-between; padding: 0 20px; + position: fixed; + top: 0; + left: 0; + width: 100%; + background-color: var(--el-bg-color, #ffffff); /* 使用 Element Plus 的背景色变量,或者您自定义的颜色 */ + z-index: 1000; + box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1); } .menu-items { diff --git a/src/style.css b/src/style.css index a1fb006..6d41124 100644 --- a/src/style.css +++ b/src/style.css @@ -33,10 +33,11 @@ a:hover { body { margin: 0; - display: flex; - place-items: center; + /* display: flex; */ + /* place-items: center; */ min-width: 320px; min-height: 100vh; + padding-top: 60px; } h1 {