Color backgounrd behind every 2nd post?

  • Author
  • #781549


    Is there a way to have a colored background behind every second post? I don’t want to apply a background color as a default behind all posts. I need to differentiate quite clearly between each post, and would like to have cream behind every second. I ahve no knowledge of CSS/html, but could add a code if one was suggested to me! Thanks!

    The blog I need help with is


    Not really. There would have to be some scripting and such added to the underlying theme files, and we do not have access to those.

    You can put a background on the text in a post using inline CSS, but the background will only be around the text you enter into the post edit window.



    Thank you. How would I add colour to the background of text in a post please? Is that a simple matter of pasting some code in the html bit; or do I need to go into the CSS section? I’m a complete novice when it comes to coding! Thank you.



    That’s described here > Background color to text >



    Thank you!



    You’re welcome. :)


    @oneequalstwo: The master of the technique thesacredpath suggested is our fellow forum volunteer Tess:


    @rich: But re the original question, I think something like this would work:

    article:nth-child(2n) {


    Hmmm, it might, but then one never knows with CSS tidy if it would strip it out or not. Did you try it and preview?



    I was too chicken to try it, so I followed the link that timechief provided above and ended up with some nifty coloured background boxes behind my intro texts, which I’m pretty chuffed with! Thanks so much, all of you! What a terrific resource you provide. It’s been so seamless putting my blog together with all your help. Thanks again.


    You are welcome from me.


    @rich: Yes I tried it. It works but if you use it you need extra touches (for example, if you don’t add anything else there will be a white square around the comment bubbles). And I don’t know if Explorer understands it.


    Does Exploder understand anything?

    The white square around the comment bubble is part of the image (why did they not make that a gif or png with a transparent background?).

    I’ve added that to my CSS “tricks” file.

The topic ‘Color backgounrd behind every 2nd post?’ is closed to new replies.