From 3940683460a9d7bfd0573d588b62ee2ad9d175c0 Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Sun, 13 Oct 2024 10:26:25 +0800 Subject: fix(header): fixed header not being centered --- components/header.css | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) (limited to 'components/header.css') diff --git a/components/header.css b/components/header.css index 057ad90..845168a 100644 --- a/components/header.css +++ b/components/header.css @@ -3,25 +3,27 @@ header { position: fixed; top: 2rem; left: 0; - /* width: 75%; */ - /* width: 100%; */ - /* max-width: fit-content; */ - /* margin-left: 12.5%; */ + right: 0; + margin-left: auto; + margin-right: auto; + width: 75%; /* Adjust width as needed */ height: var(--topBarHeight); - /* justify-content: fit-content; */ align-items: center; text-align: center; - /* background: color(0, 0, 0, .1); */ z-index: 1000; - /* background: rgba(0, 0, 0, 0.2); */ background-color: #000; border-radius: 32px; - transition: all 0.1s; -webkit-user-select: none; /* Safari */ -ms-user-select: none; /* IE 10 and IE 11 */ user-select: none; /* Standard syntax */ } +.navBar { + display: flex; + justify-content: space-between; + align-items: center; +} + .navBar a { font-family: var(--font-jetbrains); position: relative; @@ -47,6 +49,14 @@ header { .navBar .hleft a {float: left;} .navBar .hright a {float: right;} +.hleft, .hright { + display: flex; +} + +.hright { + gap: 1rem; /* Adjust the gap between links as needed */ +} + .navBar a::after { content: ''; position: fixed; @@ -101,7 +111,7 @@ header:hover, header:active, #navBarHeader:active, .navBar:active { - transform: scale(1.05); + transform: scale(1.01); /* transition: transform 700ms; */ } -- cgit v1.2.3