WordPress.org

Ready to get started?Download WordPress

Forums

Customizr
[resolved] Child theme css not overriding all of the code in the parent css (7 posts)

  1. Seahawksean
    Member
    Posted 8 months ago #

    For some reason my child css is not overriding all the code of the blue.css file located in customizr/inc/css.

    Here's a link to the site:
    http://www.biologydesign.com/SarahCHanson

    I'm trying to change the search submit button and move the menu. I have correctly created my child style.css file and imported the customizr parent style.css. Also, I checked the page source and the child style.css is being called AFTER the blue.css file.

    However, some of the changes I make in the child css works and some are being overridden by the parent blue.css apparently. I've even added some specificity to the selectors in the css or tried "!important", yet none of it has any affect. This doesn't make any sense to me. I have been able make some of the changes using the Custom CSS field but I'd rather be able to make ALL the changes in the child style.css.

    Has anyone else run into this issue or know what may be causing this issue?

    Thank you in advance for your help.

  2. rdellconsulting
    Member
    Posted 8 months ago #

    1) I'd stick with the child theme rather than CustomCSS.

    2)Sounds like you have a good understanding of CSS (eg specificity, !important). What tools do you use if any? Most of my diagnosis is done using Firebug within Firefox. I can see where blue.css & your style.css are working together.

  3. Andrew Nevins
    Spam zapper & Volunteer Moderator
    Posted 8 months ago #

    Sounds like you just need to use more specific selectors.

  4. ElectricFeet
    Member
    Posted 8 months ago #

    I have less than 2 months experience of CSS, so forgive me if this is a wrong, but I note that your style file has lines like:

    //Nav/Menu
    ...
    //Slider

    Is that allowed in a CSS file? I thought comments were delimited thus:
    /* ... */

  5. Seahawksean
    Member
    Posted 8 months ago #

    Thank you all for the replies!.

    @rdellconsulting, I use Firebug and it's indicating that the styling is being pulled from blue.css. And yes, I really don't want to use the Custom CSS. There's something glitchy about it.

    @Andrew Nevins, I was even using long strings of selectors trying to give it more specificity but there was still no result.

    @ElectricFeet, thank you! It helps to have a noobie's eyes sometimes! That's why I encourage them to participate in these forums even if they are still learning. You found the issue! I forgot // sometimes doesn't work. I changed the comment to enclose them in /* */ and it is now rendering the code from the child style.css. Thank you again!!!

  6. rdellconsulting
    Member
    Posted 8 months ago #

    I forgot // sometimes doesn't work

    // always works as a comment in php, not CSS ;)

  7. ElectricFeet
    Member
    Posted 8 months ago #

    Sounds like you just need to use more specific selectors.

    Or download the chart :-)

Reply

You must log in to post.

About this Theme

About this Topic