How to Move an iframe in HTML – Best Ways to Reposition It? or Struggling with Positioning – How to M

14 Replies, 1219 Views

Ugh, iframes are the worst. Had the same issue last week.

Instead of absolute, try `position: relative` on the parent and tweak the iframe with margins or transform.

```css
.parent {
position: relative;
}
iframe {
margin-left: 20px; /* or transform: translateX(20px) */
}
```

Less hacky, I promise.

Messages In This Thread



Users browsing this thread: 1 Guest(s)