WordPress.org

Support

Support » Themes and Templates » [Resolved] Child Theme won't override parent CSS

[Resolved] Child Theme won't override parent CSS

  • 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?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator Michael

    @alchymyth

    Forum Moderator

    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

    It’s always the little things that kill you.

    Thanks so much for the help!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Resolved] Child Theme won't override parent CSS’ is closed to new replies.