How to Make Unresponsive iFrames and Ads Responsive with CSS Transform
Third-party embeds — ad tags, iframes, widgets — come with hardcoded width and height attributes you can’t override. CSS width: 100% won’t…
How to Make Unresponsive iFrames and Ads Responsive with CSS Transform

Third-party embeds — ad tags, iframes, widgets — come with hardcoded width and height attributes you can’t override. CSS width: 100% won’t help — the embed ignores it. The fix: measure the parent container’s width, divide by the embed’s fixed width to get a scale ratio, then apply it via transform: scale(). Since transform is purely visual and doesn’t affect layout, the parent’s height must also be corrected manually to prevent overflow.
Codepen Example:
메타데이터
- post_id
- e4a6508077fa
- slug
- how-to-make-unresponsive-iframes-and-ads-responsive-with-css-transform-e4a6508077fa
- url
- https://javascript.plainenglish.io/how-to-make-unresponsive-iframes-and-ads-responsive-with-css-transform-e4a6508077fa
- canonical_url
- https://javascript.plainenglish.io/how-to-make-unresponsive-iframes-and-ads-responsive-with-css-transform-e4a6508077fa
- author_url
- https://medium.com/@cngzilhn
- status
- ok
- fetched_at
- 2026-07-10 23:10:23