【发布时间】:2016-01-08 01:51:23
【问题描述】:
我有一个响应式 Adsense 广告单元,我想将它用作我的响应式网站的页脚。我正在使用媒体查询,如 Adsense 文档中所述,以便在不同的屏幕宽度下设置高度/宽度。
这是我的 CSS:
<style>
@media (min-width: 320px) {
.adslot-desktop {
width: 320px;
height: 50px;
display: inline-block;
}
}
@media (min-width: 500px) {
.adslot-desktop {
width: 468px;
height: 60px;
display: inline-block;
}
}
</style>
这是我的 HTML:
<ins class="adsbygoogle adslot-desktop"
data-ad-client="xxxxx"
data-ad-slot="xxxxxx"
data-ad-format="auto"></ins>
在屏幕宽度超过 500 像素时,我得到了预期的 468x60 广告。但是,低于 500 像素时,我会看到 320x100 的广告。
为什么它没有像我指定的那样为我提供 320x50 广告?
【问题讨论】: