Responsive Adsense ad resizing with screen orientation change (while using Bootstrap for layout)

前端 未结 5 1527
后悔当初
后悔当初 2021-01-25 09:42

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 expec

5条回答
  •  醉梦人生
    2021-01-25 10:20

    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.

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

    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.

提交回复
热议问题