PDA

View Full Version : using CSS in advertisements


turbosatan
09-21-2009, 08:56 AM
Hi

I have 4 diufferent colour skins in my forum and would like to reflect these in some of the ads i am showing.

The ad code which i have been given uses some conditionals to specify the colours etc and i was woindering how i tell it to use the main CSS instead.

example of code

link_font_color='000000';
link_font_hover_color='000000';
background_color='ffffff';

what i would like to do is change that so that it uses the css class which the template uses to blend the ads in much better.

oh also the code is setup inside javascript similar to how google adsense code is given.

I plan to create a seperate set of css files specifically for ads but thats not that important.

Thanks in advance for your help

Princeton
09-21-2009, 01:33 PM
add the inline CSS to your headinclude template

use the same trigger/conditional that you have for displaying the ads

turbosatan
09-21-2009, 02:16 PM
ok i founhd the info i was looking for by looking at the google adsense integration.

for those who want to do somethign similar and have ad colours change with your forum skin you can use

google_color_border = "$stylevar[alt2_bgcolor_hex]";
google_color_bg = "$stylevar[alt1_bgcolor_hex]";
google_color_link = "$stylevar[body_link_n_fgcolor_hex]";
google_color_text = "$stylevar[body_fgcolor_hex]";
google_color_url = "$stylevar[body_link_n_fgcolor_hex]";

for example. i just transplanted these into my new ad code and they worked fine.

Anyone know if there is a definitive list of all the available stylevar variables written down anywhere?