• I’m fairly new to wordpress and am using a child theme for the first time. I’ve created style.css in the new child directory and have imported a couple of the parent stylesheets.

    I’ve had several instances where I’ve targeted an element (using Firebug) to make a change in the child style.css, only to have it ignored/overwritten by one of the parent css files.

    The site http://www.camptalltimbers.net
    Example: using firebug, locate <section id=”intro-message”>
    I tried adding a linear-gradient background in my child CSS – it is being overwritten by the “custom.css” of the parent theme. NOTE: custom.css is one of the imported stylesheets in the new child css. Shouldn’t the imported styles be overwritten by new child styles below?

    Thanks for your time.

Viewing 2 replies - 1 through 2 (of 2 total)
  • First, it appears that you are using a Commercial Product for your theme and as such should consult with theme provider for support on use of Child Themes.

    That said (do above first please):

    I do not see a Child Theme stylesheet in use. Did you activate Child Theme?

    I’ve created style.css in the new child directory and have imported a couple of the parent stylesheets

    You only need to have the one stylesheet per the example listed in the codex, then add styles that are new or are to override parent theme styles.

    So no, you need to remove those stylesheets and leave just the one style.css normally (which is not just a copy of the CSS in the parent theme). Try that and report back if still an issue.

    Note, you can use @import in the child theme stylesheet for those other parent stylesheets and then override them in the child theme stylesheet. (although too many @imports is considered poor design -as it is, many site metric tools complain if just one is used)

    Speaking of metrics, your site is a bit laggy:

    http://gtmetrix.com/reports/www.camptalltimbers.net/RLaf2rw3

    Thread Starter sacattac

    (@sacattac)

    Thanks for your time PVWD. The child theme has been activated and there is a style.css in its directory. It is the only css within the child hierarchy. I’ve cut the @imports to just the main style.css of the parent. The main culprit is layout.css in the parent theme directory. I’ve spoken to the theme co. and they’re looking into the issue as well.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Child CSS being overwritten by parent’ is closed to new replies.