Site logo

Archived topic

H2 text style overwritten by DIV

2 replies · Started by Anonymous on June 6, 2016

Viewing posts 1–3 of 3

Hi,

I have edited the text style using Wordpress's menu Appearance->Editor
and added in the second to make my H2 font look bold.

h2
{
text-decoration: underline;
font-weight: bold
color: #257
}

After the change, I notice the font color has changed.
On closer look, the style for H2 font is overwritten by the div.

May I know what causes it, and how I can custom the H2 font properly?
Thank you.

Hi

Have you tried changing the h2 font weight gloabally at " Appearance > Customize > Typography > Content Typography" ? Thats the better option i think since your changes will not be overwritten when you update the theme.

Alternatively you can target individual elements by preceding the h2 with that element's selector like this. You can do this in your child theme.

.home h2 {
  font-weight: bold;
  color: #257;
  text-decoration: underline;
}

The above code will affect all h2 on the page set as your home page. Hope that was helpful.

That's the way to do it for sure.

On closer look, the style for H2 font is overwritten by the div

Not sure what you mean by this?

This archived topic is closed to new replies.