Timothy Adams Timothy Adams - 3 months ago 15
CSS Question

Parent font-size is being effected by child's font-size

I have some very simple code which is:

<p>
<h3>Title is here</h3>
This is the paragraph
</p>


CSS:

h2 {font-size:2.3em;}
h3 {font-size:1em;}
p {font-size:0.5em;}


Despite my font-size being set to different numbers in the CSS, the
<p>
always ends up using the
<h3>
font-size. I know you're probably saying, just put the
<h3>
tag on the outside! But I can't. Not allowed in this case. What's going on?

Answer

By defining the font-size with px and adding !important to the end, everything was fixed.