响应式 Adsense 广告随着屏幕方向的变化而调整大小(同时使用 Bootstrap 进行布局) [英] Responsive Adsense ad resizing with screen orientation change (while using Bootstrap for layout)

查看:33
本文介绍了响应式 Adsense 广告随着屏幕方向的变化而调整大小(同时使用 Bootstrap 进行布局)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的网站上,我使用 Bootstrap 3.2 进行响应式设计,并尝试在其中嵌入 Adsense 响应式添加.我在方向更改方面遇到问题:我希望添加会在此类事件上调整大小,但它不会发生.Adsense 准备好这样的功能了吗?Adsense 博客上的一些旧帖子说:

On my website I am using Bootstrap 3.2 for responsive design and I am trying to embed Adsense responsive adds there. I am having problems with orientation changes: I would expect that adds would resize on such event, but it doesn't happen. Is such feature ready for Adsense? Some old post on Adsense blog says:

新的广告代码仅在初始页面加载时响应.随后的对广告尺寸的更改(例如屏幕方向更改)不会导致显示新广告.我们知道这是一个重要的为你们中的许多人提供的功能,我们目前正在努力解决这个问题.

The new ad code is responsive on initial page load only. Subsequent changes to the ad size, such as a screen orientation change, will not cause a new ad to be displayed. We know that this is an important feature for many of you and we’re currently working to address this.

当前文档并未提及此类问题.这个调整大小有效吗?

But current documentation doesn't mention such issue. Does this resizing work?

推荐答案

所以事实证明我引用的博客文章是关于高级模式(允许通过 CSS 指定确切广告尺寸的模式).尽管 Google 在一年多前就意识到了这个问题,高级广告不会在屏幕方向改变时自动调整大小.

So it turns out the blog post I was quoting is about advanced mode (mode which allows specifying exact ad size via CSS). Even though more than a year ago Google recognized the problem, the advanced ads are not resizing automatically when screen orientation chages.

AdSense 文档指出,自适应广告会随着方向的变化而调整大小.确实如此,但仅适用于默认广告(不是高级广告).

The AdSense documentation states that responsive ads resize with orientation changes. That's true, but only for default (not advanced ads).

高级模式允许使用@media CSS 规则指定准确的广告尺寸,这很好.但对我来说,通过使用 div 容器包装默认响应式广告,可以实现几乎相同的目标.容器的大小也可以由 CSS @media 规则指定,所以我的结果与高级广告相同 + 当屏幕方向改变时,我可以从调整广告的大小中受益.

The advanced mode allows specifying exact ad sizes with @media CSS rules which is nice. But for me it was possible to achieve almost same thing by wrapping default responsive ads with div container. The container's size can also be specified by CSS @media rules, so I have same result as with advanced ads + I get benefit of ads resizing when screen orientation changes.

这篇关于响应式 Adsense 广告随着屏幕方向的变化而调整大小(同时使用 Bootstrap 进行布局)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆