I'm trying to create a site and started with the navbar. I'm trying to center the logo and give the subs/links (? don't know what they're called, the a-tags) a little more space.
I tried following some video tutorials and Stackoverflow answers but they caused the left 3 links to be more downwards and the 3 right links to be above everything else, and caused the overall header size to almost double. I'd hugely appreciate it if someone could help me out! :) There might be some trash code that's not needed or is a bad practice overall, but incase it wasn't clear I'm a total beginner when it comes to web design :p
body {
margin: 0;
font-family: 'Open Sans', sans-serif;
}
.header {
overflow: hidden;
background-color: #262e28;
padding: 10px 10px;
box-shadow: 0px 2px 8px #888888;
}
.header a {
color: white;
text-align: center;
padding: 12px;
text-decoration: none;
font-size: 14px;
line-height: 25px;
border-radius: 4px;
}
.header a.logo {
font-size: 25px;
color: white;
display: block;
margin-left: auto;
margin-right: auto;
width: 50%;
}
.header a:hover {
color: #aeaeae;
}
.header a.active {
color: #aeaeae;
}
.header-right {
float: right;
}
.header-left {
float: left;
}
@media screen and (max-width: 500px) {
.header a {
float: none;
display: block;
text-align: left;
}
.header-right {
float: none;
}
}
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="assets/style.css">
<link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@300&display=swap" rel="stylesheet"></head>
<body>
<div class="header">
<div class="header-right">
<a href="#"><b>1</b></a>
<a href="#"><b>2</b></a>
<a href="#"><b>3</b></a>
</div>
<a href="#" class="logo">LOGO</a>
<div class="header-left">
<a href="#"><b>4</b></a>
<a href="#"><b>5</b></a>
<a href="#"><b>6</b></a>
</div>
</div>
</body>
</html>