I need to document this properly later, but here are some links I used when fiddling with iframe elements:
- [WayBack] javascript – Multiple iFrames Next To Each Other – Stack Overflow
- [WayBack] html – Why cant I have 2 iframes side by side with total width 100%? – Stack Overflow
- [WayBack] javascript – how to refresh an iframe automatically – Stack Overflow
- [WayBack] An Iframe i need to refresh every 30 seconds (but not the whole page) – Stack Overflow
A few things I learned:
- You can either put the iframe elements in different divs then arrange the divs, or put a different ID on each iframe and arrange the iframe. In either case you will need a
float: left;
in your style and awidth: 100vw
in thediv
around all your frames. - Be aware that
100%
isn’t 100% out of the box: default browser styles have a margin around your page and a border around an iframe.
So you will need to fiddle withmargin
andborder-width
inside your styles for body and iframe. Easiest is to set them tonone
or0
. - Viewport width/height works easier for me than raw %.
- For one-off situations, I like the good old meta refresh over fiddling with JavaScript.
–jeroen