I'm trying to add Amazon banners to a website (powered by WordPress) and make it responsive. I tried something like
.adbanner {
position: relative;
width: 100%;
padding: 64% 0 0 0;
height: 0;
overflow: hidden;
}
.adbanner iframe,
.adbanner object,
.adbanner embed,
.adbanner table,
.adbanner img {
position: absolute;
top: 0;
left: 0;
width: 100% !important;
height: 100% !important;
}
and
<div class="adbanner">
<!-- copied and pasted Amazon code -->
<iframe src="http://rcm-fe.amazon-adsystem.com/blah/blah/blah...">
</div>
However, on mobile devices (or in a shrunk browser window), the banner still has its original size and does not fit in the window.
I tried to control the size by JavaScript, but it didn't work because of crossdomain. Is there any way to control the size of iframe content?