Jamieɇ Bernard Jamieɇ Bernard - 3 months ago 7
CSS Question

Putting an <H2> with my text <p> while having it styled with "text-align:center;" don't work

This is for a drop down menu of 4 columns.

On the first column with is the "HOME" within a div, I have the text "HOME" in a tag.

ex.

<p style="text-align:center;"> HOME </p>


now if I try an add in
<H2> </H2>
between HOME, it cancels out the text-align:center and just uses the H2.

What so I need to do in the css to keep both the style="text-align:center and H2 in the same tag?....if possible anyway, because I like to keep the text-align:center with H2 on the text in the same paragraph

Answer

Try below

<h2>
<p style="text-align:center;">HOME </p>
</h2>
Comments