Welcome to WebmasterWorld Guest from 34.204.203.142

Forum Moderators: martinibuster

Message Too Old, No Replies

Responsive ads ignoring CSS settings?

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

New User

joined:Sept 12, 2017
posts:13
votes: 2


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...
12:17 pm on Aug 24, 2018 (gmt 0)

Senior Member

WebmasterWorld Senior Member Top Contributors Of The Month

joined:Nov 13, 2016
posts:1194
votes: 288


If you want to have "only" 300x250 ads, then you need to disable "Similar Sized Display Ads"... But it will reduce the inventory.
7:17 pm on Aug 24, 2018 (gmt 0)

Senior Member

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

joined:Dec 12, 2004
posts:662
votes: 15


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...]
7:30 pm on Aug 24, 2018 (gmt 0)

New User

joined:Sept 12, 2017
posts:13
votes: 2


levo: Ok ty I will try.
8:59 pm on Aug 24, 2018 (gmt 0)

Senior Member

WebmasterWorld Senior Member Top Contributors Of The Month

joined:Nov 13, 2016
posts:1194
votes: 288


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)
9:50 pm on Aug 24, 2018 (gmt 0)

Senior Member

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

joined:Dec 12, 2004
posts:662
votes: 15


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.