22301009 | 7ff51f2 | 2025-04-15 21:35:28 +0800 | [diff] [blame] | 1 | /* 竖直导航栏的容器 */ |
| 2 | .user-nav-container { |
Krishya | c0f7e9b | 2025-04-22 15:28:28 +0800 | [diff] [blame] | 3 | margin-right: -5%; |
| 4 | margin-left: 5%; |
| 5 | width: 150px; /* 增加容器宽度 */ |
Krishya | c0f7e9b | 2025-04-22 15:28:28 +0800 | [diff] [blame] | 6 | padding-top: 20px; |
| 7 | height: 100%; /* 让容器填充整个父容器高度 */ |
| 8 | display: flex; |
| 9 | flex-direction: column; |
| 10 | align-items: stretch; /* 确保所有导航项都拉伸 */ |
| 11 | } |
| 12 | |
| 13 | /* 导航栏样式 */ |
| 14 | .user-nav { |
| 15 | display: flex; |
| 16 | flex-direction: column; |
| 17 | padding: 0; |
| 18 | margin: 0; |
| 19 | flex-grow: 1; /* 使导航栏占据剩余空间 */ |
| 20 | } |
| 21 | |
| 22 | /* 每一项导航链接 */ |
| 23 | .user-nav-item { |
| 24 | /* padding: 35px 20px; */ |
| 25 | border-radius: 16px; /* 圆角边框 */ |
| 26 | padding: 25% 10%; |
| 27 | text-decoration: none; |
| 28 | color: #ddd; |
| 29 | font-size: 16px; |
| 30 | /* 删除 border-bottom 属性以移除分隔线 */ |
| 31 | transition: background-color 0.3s ease; |
| 32 | /*文字居中显示*/ |
| 33 | text-align: center; |
| 34 | } |
| 35 | |
| 36 | /* 鼠标悬浮时的背景颜色 */ |
| 37 | .user-nav-item:hover { |
22301009 | 1e2aea7 | 2025-06-08 16:35:54 +0800 | [diff] [blame] | 38 | background-color: #fffaf7; |
Krishya | c0f7e9b | 2025-04-22 15:28:28 +0800 | [diff] [blame] | 39 | } |
| 40 | |
| 41 | /* 激活项的样式 */ |
| 42 | .user-nav-item.active { |
22301009 | 1e2aea7 | 2025-06-08 16:35:54 +0800 | [diff] [blame] | 43 | background-color: #eecfc1; |
Krishya | c0f7e9b | 2025-04-22 15:28:28 +0800 | [diff] [blame] | 44 | color: white; |
| 45 | } |