【问题标题】:How can I eliminate space/margins between two google ads?如何消除两个谷歌广告之间的空间/边距?
【发布时间】:2016-12-08 02:39:13
【问题描述】:

如何消除中间的空格 these two google ads 看起来更像this?

我正在使用 wordpress,并且正在尝试插入我的广告感知代码。我尝试了不同的尺寸,甚至是响应式尺寸,但边距/空格总是将广告分开。

这是我的广告感知代码:

<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- Responsive -->
<ins class="adsbygoogle"
 style="display:block"
 data-ad-client="ca-pub-00000000000"
 data-ad-slot="000000"
 data-ad-format="auto"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>

【问题讨论】:

    标签: wordpress adsense


    【解决方案1】:

    只需浮动两个宽度为 50% 的 div,然后将您的广告代码放入其中。

    .half {
      float: left;
      width: 50%;
    }
    
    .clear {
      clear: both;
    }
    <div class="wrapper">
        <div class="half">
          place your first ad code here
        </div>
        <div class="half">
          place your second ad code here
        </div>
    </div>
    <div class="clear"></div>

    如果 AdSense 无法确定可用高度,您还可以将 min-height: 100px 设置为 .wrapper

    【讨论】:

      猜你喜欢
      • 2014-02-12
      • 1970-01-01
      • 2012-04-29
      • 1970-01-01
      • 1970-01-01
      • 2018-09-03
      • 2022-01-23
      • 2014-07-12
      • 1970-01-01
      相关资源
      最近更新 更多