• Resolved cadfile

    (@cadfile)


    Working on a child theme and want to add background colors to the odd and even comments on the page.

    The usual css styling is this

    .commentlist .even .comment {
    background-color:#ccddf2;
    } 
    
    .commentlist .odd .comment {
    background-color:#CCCCCC;
    }

    But it is not working with Twentysixteen even though the classes do exist in the theme.

    Any clue as to what I’m doing wrong?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Your selectors are a bit off. Try this:

    .comment-list .even.comment {
    background-color:#ccddf2;
    } 
    
    .comment-list .odd.comment {
    background-color:#CCCCCC;
    }
    Thread Starter cadfile

    (@cadfile)

    That was the problem. commentlist had become comment-list and I didn’t even notice it.

    Thanks for the help.

    Doug,

    mind sharing a link to a page with Twenty Sixteen child theme where your mod to the comments can be seen?

    Thread Starter cadfile

    (@cadfile)

    It was on a local development system on my PC using XAMPP so there isn’t a link to share. Sorry, but the problem was the selector name had changed and once I added the hyphen the css worked.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to use the odd even class in comments’ is closed to new replies.