how to center a heading in css code example
Example 1: center h1 css
h1 {
width:500px;
margin: 0 auto;
background: gray;
text-align: center;
}
Example 2: center text in css
.class {
text-align: center;
}
h1 {
width:500px;
margin: 0 auto;
background: gray;
text-align: center;
}
.class {
text-align: center;
}