It’s a common requirement to have iFrames adapt to different screen sizes, especially with the increasing variety of devices used to access the web today. Fortunately, it’s entirely possible to make iFrames responsive.
1. Auto Parameter for Responsiveness:
By simply setting the auto
parameter to 1
(&auto=1
), you enable the iFrame to be responsive.
Example:
<iframe src=”//go.goaserv.com/banner.go?spaceid=XXXXXXX&keywords=&auto=1&size=!autodetect” width=”300″ height=”250″ frameborder=”0″ scrolling=”no”></iframe>
2. Autodetect Parameter for Best Fit:
The size parameter can be set to “autodetect” (removing “!”) to let the system decide on the optimal creative size. This will instruct the system to try and find the best-fitting creative for the iFrame’s given dimensions.
Example:
<iframe src=”//go.goaserv.com/banner.go?spaceid=XXXXXXX&keywords=&auto=1&size=autodetect” width=”300″ height=”250″ frameborder=”0″ scrolling=”no”></iframe>