• Resolved shindesharad71

    (@shindesharad71)


    i want to change the background color of comments.

    i want to set different background color for admin comments and visitor comments. how i do that??

    thanks

Viewing 11 replies - 1 through 11 (of 11 total)
  • Hi shindesharad71. Try adding this to your custom css or child theme style.css. Change the colors as desired:

    /* visitor comments background yellow */
    .comment .comment-body p {
      background-color: #ff0;
    }
    /* post author comments background green */
    .comment.bypostauthor > .comment-body p {
      background-color: #0F0;
    }
    Thread Starter shindesharad71

    (@shindesharad71)

    Thanks for very quick help.
    its working…!!

    How can i make it more stylish??

    More stylish? Maybe you could elaborate a bit on what that means.

    Thread Starter shindesharad71

    (@shindesharad71)

    a round cut bx around the comments.
    that all i mean here sir,

    You mean like a border around the comments colored background with rounded corners? Or, can you post a link to a site that has an example of what you’re after?

    Thread Starter shindesharad71

    (@shindesharad71)

    like this site but different color for admin and visitor

    OK. If you take a look at the comments on this post on the theme demo, it shows that the theme supports threaded comments. So, in that case, are you wanting one colored box around each thread which includes all comments in that thread? Or are you looking for a separate colored box around each individual comment?

    Thread Starter shindesharad71

    (@shindesharad71)

    Thanks for all your help sir.
    i realy feel glad to reaching out here.

    Thread Starter shindesharad71

    (@shindesharad71)

    i want every separate box .

    If you’ve applied the css I posted earlier, remove it and replace it with the following. This will place a border and light gray background around each comment thread, and color the author comments green and visitor comments yellow. Change the colors as needed:

    /* border and background on each comment thread */
    .commentlist > .comment {
      border: 1px solid #ccc;
      background-color: #f5f5f5;
      margin: 10px 0;
    }
    /* default comments background yellow and spacing */
    .comment .comment-body {
      border: 1px solid #ccc;
      background-color: #ff0;
      line-height: 1.25em;
      padding: 3px 5px;
      margin: 5px;
    }
    /* post author comments background green */
    .comment.bypostauthor > .comment-body {
      background-color: #0F0;
    }

    Here’s a screenshot of what it looks like.

    Thread Starter shindesharad71

    (@shindesharad71)

    Got it!!
    thanks sir.

    Topic resolved.

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

The topic ‘Change comment css like bg color’ is closed to new replies.