如何消除两个Google广告之间的空间/边距?

时间:2016-10-19 04:26:15

标签: wordpress adsense

如何消除之间的空格 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>

1 个答案:

答案 0 :(得分:0)

只需浮动两个宽度均为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