Google AdSenseをレスポンシブサイトに対応させる方法ですが、Google AdSenseではコードを修正することを禁止しておりますので、自己責任でお願いします。<div id="google-ads-1"> <script type="text/javascript"> adUnit=document.getElementById("google-ads-1"); adWidth=adUnit.offsetWidth;google_ad_client="ca-pub-1234567890"; google_adtest="on"; if(adWidth>=768){ google_ad_slot="00000000000"; google_ad_width=768; google_ad_height=90; }else if(adWidth>=468){ google_ad_slot="1111111111"; google_ad_width=468;google_ad_height=60; }else if(adWidth>=300){ google_ad_slot="222222222"; google_ad_width=300;google_ad_height=250; }else if(adWidth>=250){ google_ad_slot="333333333"; google_ad_width=250; google_ad_height=250; }else{ google_ad_slot="0"; google_ad_client="0"; adUnit.style.display="none"; } </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script> </div>Soruce:How to use Google AdSense Ads with Responsive Web Design
Google AdSenseをレスポンシブサイトに対応させる!
