Responsive design 谷歌Adsense响应广告-在更大的屏幕上使用两个广告?
我目前正在试用谷歌Adsense响应式广告,效果很好,但是当屏幕大小超过特定大小时,有没有办法显示两个广告 例如,当屏幕尺寸大于620像素时,显示两个相邻的“250 x 250”广告(而不是仅显示一个)?您可能不会放置两个广告(没有可能导致各种问题的服务器端编码),但您可以使用媒体查询增加或减少广告的大小以实现类似的行为。例如:您可以显示-Responsive design 谷歌Adsense响应广告-在更大的屏幕上使用两个广告?,responsive-design,adsense,Responsive Design,Adsense,我目前正在试用谷歌Adsense响应式广告,效果很好,但是当屏幕大小超过特定大小时,有没有办法显示两个广告 例如,当屏幕尺寸大于620像素时,显示两个相邻的“250 x 250”广告(而不是仅显示一个)?您可能不会放置两个广告(没有可能导致各种问题的服务器端编码),但您可以使用媒体查询增加或减少广告的大小以实现类似的行为。例如:您可以显示- 手机上的300x250广告 片剂上的336x280广告(最小宽度为500) 728x90桌面广告(最小宽度为800) 大分辨率台式机上的970x250广告(
<style>
.responsive2 { width: 300px; height: 250px; }
@media(min-width: 500px) { .responsive2 { width: 336px; height: 280px; } }
@media(min-width: 800px) { .responsive2 { width: 728px; height: 90px; } }
@media(min-width: 1200px) { .responsive2 { width: 970px; height: 250px; } }
</style>
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- Responsive2 -->
<ins class="adsbygoogle responsive2"
style="display:inline-block"
data-ad-client="ca-pub-XXXXX"
data-ad-slot="YYYYY"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
.响应2{宽度:300px;高度:250px;}
@介质(最小宽度:500px){.responsive2{宽度:336px;高度:280px;}
@介质(最小宽度:800px){.responsive2{宽度:728px;高度:90px;}
@介质(最小宽度:1200px){.responsive2{宽度:970px;高度:250px;}
(adsbygoogle=window.adsbygoogle | |[]).push({});
有关advanced responsive adsense广告的更多详细信息,请参阅您不能放置两个广告(没有可能导致各种问题的服务器端编码),但您可以使用媒体查询增加或减少广告的大小,以实现类似的行为。例如:您可以显示-
<style>
.responsive2 { width: 300px; height: 250px; }
@media(min-width: 500px) { .responsive2 { width: 336px; height: 280px; } }
@media(min-width: 800px) { .responsive2 { width: 728px; height: 90px; } }
@media(min-width: 1200px) { .responsive2 { width: 970px; height: 250px; } }
</style>
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- Responsive2 -->
<ins class="adsbygoogle responsive2"
style="display:inline-block"
data-ad-client="ca-pub-XXXXX"
data-ad-slot="YYYYY"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
.响应2{宽度:300px;高度:250px;}
@介质(最小宽度:500px){.responsive2{宽度:336px;高度:280px;}
@介质(最小宽度:800px){.responsive2{宽度:728px;高度:90px;}
@介质(最小宽度:1200px){.responsive2{宽度:970px;高度:250px;}
(adsbygoogle=window.adsbygoogle | |[]).push({});
有关高级响应adsense广告的更多详细信息,请参阅