H1 not centering; what am I doing wrong?

Hey y’all I don’t get why my h1 isn’t centering. I’m trying to make valley volley survey form be in the middle of the page-top. It keeps staying on the left. I’ve also tried centering it with it’s id selector, but nothing changes.

Here’s the code:

 body{
    background-image: url("photo1.jpeg");
    background-position: center;
    background-size: auto;
    background-repeat: no-repeat;
    height: 1200px;
    width: 321px;
    height: auto;
}
h1{
    margin: 0 auto;
    color: aquamarine;
    width: 300px;
    text-align: center;
}

Hi @iosagie

Welcome to FCC.

You have set the width of the body element to 321px and that of h1 to 300px. Try removing the width you have set to the h1 and the body elements.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.