Support » Fixing WordPress » CSS Specificity

  • How can i make the first rule (in my child themes style.css) to overrride the second one (parents css)?

    Rule #1: #site-description {
    clear: right;
    float: left;
    color: #3D4258;
    font-style: italic;
    margin: 15px 0 18px 0;
    width: 220px;
    font-size: 200%
    font-family: arial;
    }

    Rule #2: #site-description {
    clear: right;
    float: right;
    font-style: italic;
    margin: 15px 0 18px 0;
    width: 220px;
    }

Viewing 4 replies - 1 through 4 (of 4 total)
  • Michael

    (@alchymyth)

    Forum Moderator

    How can i make the first rule (in my child themes style.css) to overrride the second one (parents css)?

    in what aspects?

    what is not working for you?
    can you post a link?

    generally, the child theme’s stylesheet should be loaded after the one of the parent theme, and those styles should automatically overwrite the equivalent styles of the parent theme.

    For whatever reason, this ended up overriding correctly:

    #site-description {
    clear: left;
    font-size: 150%;
    float: left;
    color: #3D4258;
    }

    Not sure I understand why though.

    Moderator Andrew Nevins

    (@anevins)

    Forum moderator

    Sounds like you didn’t clear your cache when you wanted to see the immediate change.

    Im working with cloudflares development mode, and can see other changes i make. I also didnt clear the cache when it finally worked (perhaps you didnt see my reply posted at roughly the same time as yours).

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘CSS Specificity’ is closed to new replies.