<分区>
编辑问题以包含 desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem .这将有助于其他人回答问题。
关闭 5 年前。
<分区>
编辑问题以包含 desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem .这将有助于其他人回答问题。
关闭 5 年前。
我有一个使用 Bootstrap 的简单页面。 Bootstrap “容器”div 中有 3 个 div:
我希望广告和表单控件之间有一些垂直空间。但是,无论我做什么,adsense 广告都与表单控件齐平。
我已经尝试使用 Bootstrap div 类(例如,下面是我认为应该创建顶部和底部垂直边距的 my-1)并手动添加
(抱歉,我没有想法,不要'对 bootstrap 或 adsense 没有太多经验)
<div class="container">
<div>
<h3>name check</h3>
</div>
<div>
<ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-9999999991673999"
data-ad-slot="9954999999"
data-ad-format="auto"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</div>
<div class="my-1">
<div class="input-group input-group-lg">
<input type="text" class="form-control" placeholder="name" id="btn-name" />
<span class="input-group-btn">
<button class="btn btn-default" id="btn-check">check</button>
</span>
</div>
</div>
最佳答案
你可以添加一些CSS
.my-1 {
margin-top: 1em;
}
或者你可以添加内联 css:
<div style="margin-top:1em;">
<div class="input-group input-group-lg">
<input type="text" class="form-control" placeholder="name" id="btn-name" />
<span class="input-group-btn">
<button class="btn btn-default" id="btn-check">check</button>
</span>
</div>
</div>
关于html - 为什么 adsense 和输入组之间没有垂直空间?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45074230/