I can't get my header to center

Here is the CSS I’m using for my header:

position: fixed;
top: 0;
margin: 0 auto;
background-color: #9fbfdf;
height: auto;
width: 100%;
font-family: ‘Libre Baskerville’, serif;


Originally I was adjusting the margin-left manually, but it isn’t responsive to resizing when I do that. I added the margin: 0 auto; because that’s what I found when I looked for help with this issue but it doesn’t do anything I also tried just margin: 0; .

So what am I doing wrong?

Here’s a link to my CodePen project with the issue: https://codepen.io/MeanderingSoul/full/ywavvv

Add left: 0; to flush it to the left.

Also note that <header>, <footer> and <main> go inside the <body>

1 Like

Wow! Of course it was that easy, lol.

Thanks for that and the extra tip!