WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Child Theme won't override parent CSS (3 posts)

  1. jmek
    Member
    Posted 3 years ago #

    I can usually tweak CSS fairly well, but I am finding numerous difficulties in getting it to work with child themes. My website is at webswords.com.

    At the moment, I want to change the margin-bottom for paragraphs and lists. Adding !important to the declaration doesn't work (see below; I used an absurd margin-bottom value so it would be clearly visible).

    #content p,
    #content ul,
    #content ol,
    #content dd,
    #content pre,
    #content hr {
    	margin-bottom: 120px!important;
    }

    I've also tried adding specificity; also without success:

    #content .entry-content p {
    	margin-bottom: 120px !important;
    }

    Firebug shows that the parent CSS is controlling my paragraphs, but not why it is overriding the !important rule in the child theme.

    Any ideas?

  2. alchymyth
    The Sweeper & Moderator
    Posted 3 years ago #

    you have a typo here - see the round bracket ) instead of the curly bracket }:

    /* =End Global Text Elements
    -------------------------------------------------------------- */
    
    .search input #s {
    	border: red;
    )

    this stops the execution of (all) following styles

  3. jmek
    Member
    Posted 3 years ago #

    It's always the little things that kill you.

    Thanks so much for the help!

Topic Closed

This topic has been closed to new replies.

About this Topic