Forum Moderators: martinibuster

Message Too Old, No Replies

Responsive ads ignoring CSS settings?

         

pmays

11:34 am on Aug 24, 2018 (gmt 0)

5+ Year Member



Hi,

I am using reponsive ads since begin and I really like options to resize reponsive ad unit based on media screen size. But last half year reponsive ads are ignoring my settings and do what they want, for example I have ad with css: .my_main_ad

And then I use this CSS:
@media only screen and (max-width: 767px) {
.my_main_ad { width: 300px; height: 250px; }
}

That means, on screen under 767px width, show this ad as 300x250 banner. So i go test it to browser, set screen 500px and I see something like 260x80, totally different ad sizes. Small and not nice to click on. If i change code to this:
@media only screen and (max-width: 767px) {
.my_main_ad { width: 300px !important; height: 250px !important; }
}

Only what happens is that ad will rly have 300x250, but inside will be again destructed ad unit 260x80.

Do you have this issue to, or am I doing something wrong? Problem isn't just that I cant control all my ad unit throught all media sizes, but some media units are violating ads policy cause they ignore my settings like width, height and padding etc...

Dimitri

12:17 pm on Aug 24, 2018 (gmt 0)

WebmasterWorld Senior Member 5+ Year Member Top Contributors Of The Month



If you want to have "only" 300x250 ads, then you need to disable "Similar Sized Display Ads"... But it will reduce the inventory.

levo

7:17 pm on Aug 24, 2018 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



If you want to "specify an exact size per screen width" you need to remove 'data-ad-format="auto"' from your ad code. You might still get smaller ads that fit to your ad unit, but your adunit dimensions will be what you set.

[support.google.com...]

pmays

7:30 pm on Aug 24, 2018 (gmt 0)

5+ Year Member



levo: Ok ty I will try.

Dimitri

8:59 pm on Aug 24, 2018 (gmt 0)

WebmasterWorld Senior Member 5+ Year Member Top Contributors Of The Month



I always thought the "data-ad-format" parameter was to select the orientation of the ad (horizontal, vertical or square) (the auto letting Adsense decide)

levo

9:50 pm on Aug 24, 2018 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



horizontal, vertical and square are hints; auto is 'best guess' based on available space. Removing data-ad-format gives granular control over dimensions, but takes away auto 'ad size changes after a screen orientation change' feature.