Q:

Element width and text centering

I'm working with HTML and I need to insert a heading that is centered on the page with a color-filled, width-limited background, so that the color-fill of the heading element does not cover the whole of the page space.
Heres my code:
<head>

<h1 style="text-align:center;background-color: white;max-width: 500px;">Support</h1>

</head>

As this code goes, it centers the text within the limits of the element width and not the page. The entire page has a background image, which I want to remain as uncovered as possible.  I can center the text by excluding the width limit but this causes the element background to pass through the width of the page.  I want the color-filled heading element background in order to help the text pop from the page background.

A:

you might try putting a div around it, like
<div style="width:100%;margin:auto;text-align:center">your H1 tag here</div>

Also, do as Pamblam said: don't put this in the <head> tag, but in the <body> tag.

