H2 text style overwritten by DIV

Home Forums Support H2 text style overwritten by DIV

Home Forums Support H2 text style overwritten by DIV

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #199717
    Lim Siong Boon

    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.

    #199801
    Jamal

    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.

    Agressively support the kind of work you want to see. Buy it. Talk about it. Review it.

    #199802
    Tom
    Lead Developer
    Lead Developer

    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?

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.