How can I put the h1 with the background to the center? I searched for it but I think because I'm too new at coding, I couldn't find where to find the mistake here.
.main-header, h1{
background-color: black;
color: white;
text-align:center;
position: relative;
background-size: 100px;
display: inline;
margin: auto
width: auto;
}
body{
background-color: purple;
margin: 0;
}
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title>Lei's Gym Wiki</title>
<link rel="stylesheet" href="css/styles.css">
</head>
<body>
<div class="main-header">
<h1>Welcome To Leindras's Gym Wiki</h1>
</div>
</body>
</html>