How do I add background color to just the width of centred text?

Wrap your text inside . Heading in a span and then: heading { text-align: center; } . Heading span { background-color:red; }.

Wrap your text inside . Heading in a span and then: . Heading { text-align: center; } .

Heading span { background-color:red; }.

Many thanks Kon. That did the job nicely. – Nick May 15 at 15:12.

You won't be able to achieve this with one DIV only. You may need to enclose text into SPAN and apply background color to it. For example HTML code will look like: Sample Text And CSS code will look like: DIV.

Heading { text-align: center; } DIV. Heading SPAN { background-color: red; }.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions