Reputation: 21
I am trying to put a picture underneath my Google adsense ads on my website but I cant get it to work. It could be that I suck with CSS but I was wondering if anyone knew how to put a picture under it. I am doing this so if someone has ad blocker there will be the picture there instead saying ads support us please disable your adblocker. Here is the code for my test ad.
<script type="text/javascript"><!--
google_ad_client = "ca-pub-9190588463236669";
/* herp */
google_ad_slot = "8389049989";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
Upvotes: 1
Views: 3373
Reputation: 13169
I take it you mean hidden underneath the Google AdSense block so that the user only sees it if no AdSense ads are allowed to run?
I can't think of any way you could do that using HTML and CSS. Instead you could try using a noscript element to tell your web page how to render if the AdSense JavaScript block cannot be executed because scripts are disabled.
For example:
<script type="text/javascript">
<!-- AdSense code goes here as normal -->
</script>
<noscript>
<img src="images/ads-support-this-site.jpg" width="750" height="75" alt="Ads support this site. Please do not use plugins to disable ads." />
</noscript>
This should allow you to show a chosen JPEG image (and/or other HTML markup) if the script block does not run.
See the HTML5 noscript element definition on the W3 site for more details.
I haven't read the Google AdSense terms and conditions for a long time, and Google have always been fussy about changes made to their code. So you might want to contact Google and check with them that a noscript block is permitted by their terms and conditions, to avoid upsetting them and being kicked from the programme.
Upvotes: 2