放横幅Behing Adsense

时间:2016-01-21 05:41:07

标签: html css ads adsense

我正在为我的网站设置adsense并尝试在广告背后设置背景图片,这样如果有人使用广告块访问该网页,就会礼貌地要求他们将图片打开我想支持这个网站。目前,我已将adsense代码包装在div中并在其上设置背景图像,但是当我这样做时,我的adblock软件能够检测到它并阻止它背后的图像。有人能告诉我这是正确的吗?干杯

HTML -

get-involved\/companies\/(?:(.+(?=-[0-9]))|(.+\b))

CSS -

<div class="ad-alert">
    <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
    <!-- Listings Banner -->
    <ins class="adsbygoogle" style="display:inline-block;width:728px;height:90px" data-ad-client="ca-pub-9407013200292589" data-ad-slot="7535806952"></ins>
    <script>(adsbygoogle = window.adsbygoogle || []).push({});</script>
</div>

1 个答案:

答案 0 :(得分:0)

好的,我自己解决了。诀窍是通过CSS设置div背景颜色,然后设置一个背景图像,它具有透明背景所需的文本。以下是一个例子。

CSS -

.ad-alert {
    width: 728px;
    height: 90px;
    background: #cccccc;
    background-image: url("../images/randompeople.png");
    margin: auto;
    margin-top: 30px;
}
相关问题