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

查看:172
本文介绍了自适应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天全站免登陆