0

This is my website: http://thelolinternet.com/

As you can see, there is an ad upside of the size height="90" width="728" but when you open the website in mobile (try changing the browser width), the ad's size does not get decreased. What is the solution?

I do not know how to make it responsive.

This is the code:

<div  data-WRID="WRID-147582892358590272" data-widgetType="Push Content"  data-class="affiliateAdsByFlipkart" height="90" width="728"></div>
<script async src="//affiliate.flipkart.com/affiliate/widgets/FKAffiliateWidgets.js"></script>

And here is my code after the percentage suggestion:

<div data-WRID="WRID-147582892358590272" data-widgetType="Push Content" data-class="affiliateAdsByFlipkart" height="6.181318681318681%" width="50%"></div>
<script async src="//affiliate.flipkart.com/affiliate/widgets/FKAffiliateW‌​idgets.js"></script>
Cameron Hurd
  • 4,836
  • 1
  • 22
  • 31
David bot
  • 3
  • 2

1 Answers1

0

you can do this, test it out in your dev environment because it will not work in fiddle

device_width = window.outerWidth;
ad = document.getElementById('ad');

if (device_width == '740')
{
  ad.style.width = '700'
}
else if(device_width == '480')
{
  ad.style.width = '400'
}
<div id="ad">
  <h2>THIS IS AN AD</h2>
</div>