Forum Moderators: martinibuster

Message Too Old, No Replies

Having difficulty hiding responsive ad with meida queries

         

denisl

8:51 am on Aug 3, 2016 (gmt 0)

10+ Year Member Top Contributors Of The Month



Having difficulty hiding responsive ad with meida queries. This the style that I have in the ad code:

<style>
.xxxxx {display:inline-block; width: 120px; height: 600px; }
@media (max-width: 890px) { .xxxxx { display: none; } }
@media(min-width: 930px) { .xxxxx { width: 160px; height: 600px; } }
@media(min-width: 1070px) { .xxxxx { width: 300px; height: 600px; } }
</style>

However it does not hide in the smaller screens although I do get the different sizes according to the media queries.
I test all my ad placements and media queries with a blank image - and it works fine, but not with the actual ad.

denisl

11:22 am on Aug 3, 2016 (gmt 0)

10+ Year Member Top Contributors Of The Month



OK, I can answer my own question. I didn't notice that further down the ad code was:
style="display:inline-block"

Which was of course making it visible again.

keyplyr

11:47 am on Aug 3, 2016 (gmt 0)

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



One of those ah ha moments. We've all had 'em.

denisl

12:20 pm on Aug 3, 2016 (gmt 0)

10+ Year Member Top Contributors Of The Month



Wouldn't be so bad if it was just a moment - can feel like hours of staring at a piece of code!

trebuchet

12:35 pm on Aug 3, 2016 (gmt 0)

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



I'd like a dollar for every time I've agonised over a coding problem, phoned/emailed/posted it somewhere, then worked out the answer myself straight after.