Responsive HTML5 banner does not work

Asked

Viewed 93 times

0

I am trying to include a responsive banner on my site (wp 4.9.6), following a guide I found on the internet (I am amateur).

Banner loads normally on desktop and responsiveness works on some Android devices. It doesn’t work on tablets and IOS.

I’m using the style:

<style> 
.banner-iframe
 {position: relative;padding-bottom: 56.25%;padding-top:30px;height:0;overflow:hidden;} 
.banner-iframe iframe
 {position:absolute;top:0;left:0;width:100%;height: 100%;}
</style>

With these iframe parameters

<div class="banner-iframe">
 <iframe src="banner.html"
 style="border:0px #000000 none;" 
 name="meuBanner"
 scrolling="no"
 marginheight="0px"
 marginwidth="0px"
 width="728px"
 height="90px"
 frameborder="0">
 </iframe>
</div>
  • Your iframe is like a fixed width of width="728px", try putting 100% to see if it solves

  • Didn’t solve. The banner has its own css: <meta name="ad.size" content="width=728,height=90"> var bannerJson = (...) "width":728,"height":90,"loop" This may be the problem?

  • Attributes may not have px, only the numerical value.

  • @dvd fixed, thanks. But nothing has changed

  • was just a hint. The problem may be right on fixed width. Does the iframe page have its own CSS? It’s from another domain?

  • has its own CSS. I suspect that’s the problem. It’s in my domain.

  • Exactly. Put in the banner image width: 100%; max-width: 728px; and in the iframe the same thing that should work.

Show 2 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.