Help making my tribute page

HI, I’m trying to make the header on my page centre while the background color is limited to the text. I manage to do either but not both together, help please?

<span> <h1 class="text-center" style="background-color: orange; display: inline-block"> FOOTBALL THE BEST SPORT IN THE WORLD </h1></span>

You have to set the width:

<h1 class="text-center" style="background-color: orange; display: block; margin: auto; width: 500px"> FOOTBALL THE BEST SPORT IN THE WORLD </h1>

You can wrap in a div with text-align set to center:

html:

<div id="myHeader">
<span> <h1 class="text-center" style="background-color: orange; display: inline-block"> FOOTBALL THE BEST SPORT IN THE WORLD </h1></span>
</div>

css:

#myHeader {
	text-align: center;
}
1 Like

thanks mate, it worked!
thought there would be a HTML way of doing it.