PDA

View Full Version : How do I alternate quote box color?


HeloHi
04-23-2005, 05:21 PM
I use alternating post colors, I know that using the main CSS for a certain template to change the alt2 color sets the quote box to that color. But on the even reply posts, if someone quotes, the color of the quote box is the same color as the post itself.

So what I am wondering is, how to make the quote box alternate color to the post it is in. If it is a quote in a post that is using alt1 color, I would like the quote box to use the alt2 color, and if it is a quote in a post using alt2 color, I would like the quote box to use the alt1 color.

Am I missing something simple here? Please help!

here is my bbcode_quote template:

<div style="margin:20px; margin-top:5px; <if condition="$show['iewidthfix']">width: 100%;</if>">
<div class="smallfont" style="margin-bottom:2px">$vbphrase[quote]:</div>
<table cellpadding="$stylevar[cellpadding]" cellspacing="0" border="0" width="100%">
<tr>
<td class="alt2" style="border:1px inset">
<if condition="$show['username']">
<div><phrase 1="$username">$vbphrase[originally_posted_by_x]</phrase></div>
<div style="font-style:italic">$message</div>
<else />
$message
</if>
</td>
</tr>
</table>
</div>

I know it needs to be changed to reach the effect I desire, but I am a total n00b coder. Any suggestions?

Telkman
04-23-2005, 07:45 PM
If the post colour is simply defined through the normal .alt1/.alt2 classes, try this...

Replace:

<td class="alt2" style="border:1px inset">

With:

<td class="altquote" style="border:1px inset">

Then in your "Additional CSS Definitions" for the style in question, add css declarations for the styling you want...

e.g.

.alt1 .altquote { background: #ff0000; }
.alt2 .altquote { background: #0000ff; }

(Obviously the classes can be changed if you're using something else...)

HeloHi
04-23-2005, 08:01 PM
Thanks :)

That works, in that it alternates the color of the quote box, but it is the same color as the post it is in. I am trying to make the quote box the opposite color. I am sure it is only some small modification I need to make.

here is a sample thread:
http://www.forums.paraplanet.com/showthread.php?t=55

If I can make it to where the colors of the quote boxes are switched, then my goal would be met!

Telkman
04-23-2005, 08:04 PM
Sorry, those should be ".alt1.altquote" and ".alt2.altquote".

They went the same colour as the posts because the classes were invalid - if you just add those .'s, one will go bright red, the other bright blue, obviously you'll want to change those to your choice of colours.

HeloHi
04-23-2005, 08:19 PM
Hmmm it doesn't seem to be working...

I changed the:

.alt1.altquote { background: #dfdfdf; }
.alt2.altquote { background: #f1f1f1; }

by switching the background colors to test it, and it only seems to be using alt2 part for every quote, instead of alternating.

Telkman
04-23-2005, 08:26 PM
Try ".alt1 .altquote" and ".alt2 .altquote"

Sorry, I'm not particularly awake!

HeloHi
04-23-2005, 08:30 PM
I LOVE YOU :p

It works flawlessly! Thanks for the help, I really really appreciate it!!!