Forum Moderators: not2easy

Message Too Old, No Replies

Adsense In CSS

Not showing up

         

Jeigh

6:22 am on Mar 17, 2007 (gmt 0)

10+ Year Member



Hey guys, I'm trying to add the Adsense code onto my external CSS but it is not working properly, here is the code relevant to it:

#rightcontent {
width:174px;
height:622px;
background: #ffffff;
<script type="text/javascript"><!--
google_ad_client = "pub-################";
google_ad_width = 160;
google_ad_height = 600;
google_ad_format = "160x600_as";
google_ad_type = "text_image";
google_ad_channel = "";
google_color_border = "38B63C";
google_color_bg = "FFFFFF";
google_color_link = "0066CC";
google_color_text = "000000";
google_color_url = "2BA94F";
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
}

What is wrong with it? Also </script> and everything after than in my CSS turned green in dreamweaver after I added the code.

Thanks for any help guys :)

[edited by: SuzyUK at 9:49 am (utc) on Mar. 17, 2007]

Robin_reala

7:34 am on Mar 17, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The adsense script writes out HTML, so I’m afraid you can’t add it to your CSS (which is there for styling only). If you want to add an ad to a specific place on every page then the right technology is some sort of dynamic page generation code, for example SSI or PHP.

Jeigh

7:37 am on Mar 17, 2007 (gmt 0)

10+ Year Member



Ah ok, Thanks for the help.

benevolent001

7:43 am on Mar 17, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



But i think we can use CSS to call external javascript file and then i that file we can have ad code , but i think we might require to play with google code a bit and thats what against TOS

Tastatura

8:23 am on Mar 17, 2007 (gmt 0)

10+ Year Member




you might want to edit your post (if you still can do so, or ask a mod to do it if you can't) and obfuscate your publisher ID.

[edited by: SuzyUK at 9:49 am (utc) on Mar. 17, 2007]

Robin_reala

10:34 am on Mar 17, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



But i think we can use CSS to call external javascript file

Only in IE, using its proprietary ‘behaviour’ extension.