Hiding Larger Adsense Ads on Lower Resolution Devices.


Suppose you decide to make mobile compatible responsive website then decide which adsense unit you are going to use. Suppose You are Showing 728 x 90 ad unit on your blog or site currently then your site may be overflowed on the mobile devices. Visitors will not be able to get proper view.
This article will explain you how to put adsense code on your blog which will be hidden from mobile devices.

Step 1 : Put Adsense Code into Div Element

If you are showing adsense ad unit or any other ad unit on your blog then put adsense code in div. Put all the ad units by considering Media Type as Desktop / Laptop Screen.

and here is the CSS code for your Div -

Step 2 : Check Site on All Resolutions

Make sure that site works properly on laptop and desktop devices. PC or laptop have normally resolution more than 1024px. You have put 728X90 Leaderboard on your blog/site. Goto quirktools and check your site on lower devices such as Tablet or Notepads. Make sure that your large Leaderboard still showing in proper way.

Step 3 : Check On Mobile Devices

Now when you check your site on devices with lower resolution 480×800 or some lower resolution devices then you can see that your ad unit does not fit in the available space.

Step 4 : Using CSS3 Media Queries

Using this media query we are hiding the div element on the devices those having maximum width of 750px.