How do I center the nav bar (3 magenta items) in area (white w- gray border) though the logo is on the left? I am Ok with not using flexbox or making other structural changes to make it work.
The post for which this one is considered a duplicate does not resolve the issue satisfactorily. It adds content to the right to get centering. This content creates undesired results on narrower screens.
As far as duplicate posts are concerned, this post provides an image. The post this one "duplicates" requires readers to imagine what the author desires. This one specifically asks for a result. The "original" specifies a generic desire.
header {
position: sticky;
top: 0;
width: 100%;
display: flex;
height: 50px;
padding-top: 0 0 0 0;
background: #B6C1CC;
align-items: baseline;
}
.name {
font-family: 'Oswald', 'Roboto', sans-serif;
font-size: 32pt;
color: rgb(44, 62, 77);
line-height: 38px;
padding-left: 10;
padding-top: 5;
flex: 1;
}
.nav-bar {
display: flex;
flex: 2;
}
nav {
display: flex;
flex-direction: row;
line-height: 38px;
}
nav a {
font-family: 'Oswald', 'Roboto', sans-serif;
font-size: 24pt;
color:rgb(44, 62, 77);
line-height: 38px;
text-decoration: none;
padding: 12px 20px 0px 0px;
}
<header>
<div class="name">
Logo
</div>
<div class="nav-bar">
<nav>
<a href="">Nav 1</a>
<a href="">Nav 2</a>
<a href="">Nav 3</a>
</nav>
</div>
</header>