【问题标题】:Putting Banner Behing Adsense将横幅广告投放 Adsense
【发布时间】:2016-01-21 14:20:06
【问题描述】:

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

HTML -

<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>

CSS -

.ad-alert {
    width: 728px;
    height: 90px;
    background-image: url("../images/ad-alert-banner.png");
}

【问题讨论】:

    标签: html css ads adsense


    【解决方案1】:

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

    CSS -

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

    【讨论】:

    • 现在你需要接受你自己的答案,我知道非常元。
    • 您只能在两天后接受自己的答案。
    • 感谢您对我的教育!我没有在这里发布问题,但发现许多预先提出的问题得到了回答:-)
    猜你喜欢
    • 1970-01-01
    • 2021-02-26
    • 2019-08-12
    • 2020-06-24
    • 2020-11-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多