【发布时间】:2014-11-23 01:44:43
【问题描述】:
我在高级模式下使用自适应 AdSense 单元。在我决定调整浏览器窗口大小之前,它运行良好。广告未按照媒体查询中指定的方式调整大小。
<style>
.myad { width: 320px; height: 50px; }
@media(min-width: 500px) { .myad { width: 468px; height: 60px; } }
@media(min-width: 800px) { .myad { width: 728px; height: 90px; } }
</style>
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<ins class="adsbygoogle myad"
style="display:inline-block"
data-ad-client="XXX"
data-ad-slot="XXX"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
CSS 是正确的。在 Firebug 中,我可以看到媒体规则划掉并替换为以下内容:
element.style {
display: inline-block;
height: 90px;
width: 728px;
}
【问题讨论】:
标签: html css responsive-design media-queries adsense