Found a way to do this only with HTML / CSS. It's pretty simple to add the {Tag} block to any div class that wraps the mail area, but make sure it is between {block: Posts} and {block: Text}, etc. Now everything that you put in the message now becomes a new class.
{block:Posts} {block:Text} <div class="post {block:HasTags}{block:Tags}{Tag} {/block:Tags}{/block:HasTags}"> {block:Title}<h2>{Title}</h2>{/block:Title} <p>{Body}</p> </div> {/block:Text} {/block:Posts}
Pay attention to the third line down. itβs important to add a space after {Tag}, otherwise they will not be separated in HTML.
CSS will look like this:
.post { background: #ccc; float: left; margin: 10px; position: relative; } .blue { background: blue !important; }
Work! Pretty simple, no jquery required!
Thanks Blender, I wouldnβt think about it for some reason if I hadnβt read your jquery method :)
Naota source share