lundi 8 août 2016

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.




Aucun commentaire:

Enregistrer un commentaire