move h1 to center css code example
Example 1: center h1 css
h1 {
width:500px;
margin: 0 auto;
background: gray;
text-align: center;
}
Example 2: html move h1 to center
div{
height: 400px;
width: 800px;
background: red;
display: flex;
flex-direction: column;
justify-content: center;
text-align: center;
}