【问题标题】:CSS Google Ad positioningCSS 谷歌广告定位
【发布时间】:2012-05-26 18:12:46
【问题描述】:

我在www.FreeMinecraftHost.com 上展示我的 Google 广告时遇到问题

当我使用这段代码时:

<div class="top-bar">
        <div class="logo">
            <a href=""><img src="FMHLogo.png" alt="Logo" border=0></a>
            <div style="top:-25;"></div>
            <script type="text/javascript">
                <!--
                google_ad_client ="ca-pub-3955111504945324";
                /* Banner */
                google_ad_slot = "6834015980";
                google_ad_width = 468;
                google_ad_height = 60;
                //-->
            </script>
            <script type="text/javascript"
            src="https://pagead2.googlesyndication.com/pagead/show_ads.js"></script></div>
        </div>

    </div>

它打破了顶栏 div,广告在徽标下方,如果我取出

<div style="top:-25;"> 

那么广告就在徽标旁边,但固定在顶栏 div 的底部,有什么想法吗?

【问题讨论】:

  • 您希望它如何定位?它应该如何以正确的方式显示?

标签: html css adsense


【解决方案1】:

将广告放在自己的 div 中并更改其z-index。您可以将其设置为 1000 之类的高值,或者以编程方式设置它,以防您的页面在未来出现大量元素。例如:

div.google
{
    z-index: 1000; /*or do this programmatically with jQuery*/
    /*Other properties if required*/
}

【讨论】:

    猜你喜欢
    • 2016-08-01
    • 1970-01-01
    • 2011-10-16
    • 1970-01-01
    • 1970-01-01
    • 2018-07-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多