簡體   English   中英

CSS Google廣告定位

[英]CSS Google Ad positioning

我在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的底部,有什么想法嗎?

將廣告放入自己的div並更改其z-index 您可以將其設置為較高的值(例如1000),也可以通過編程方式將其設置為將來您的頁面包含很多元素的情況。 例如:

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM