Retaining aspect ratio and scale iframe for parent div width defined in percentage

26 Views Asked by At

I have an issue where i need to use google ads as iframes that sit nicely at max-width in Zurb Foundation. However the ads are set out of my control and I need to find a way of scaling the Ads iframe width and height to 100% of the parent div and maintain aspect ratio of each ad.

Example mark-up of what happens before the google adwords js is triggered would be:

<div class="cell resp" id="GA-ID-#####"><script>Google ads stuff in here</script></div>

I can't use the padding hack, as I wont know the aspect ratio.

Google brings me nothing thats feasible; does anyone have experience of this?

0

There are 0 best solutions below