I've half solved this issue, but without fully understanding the problem, which worries me. I wonder if someone can help me understand what is at play?
I have an iframe set to 100% width via CSS. The container div is 767px. And therefore so is the iframe.
I have the following media query in the iframe's stylesheet:
@media (max-width: 767px) {
body {
background: red;
}
}
In all popular browsers tested other than Firefox, the media query takes effect and sets the body background to red. In Firefox, the media query only takes effect when the iframe is set to 766px - 1px less even though max-width should be 'up to and including'. This seems like a bug. My workaround for now is to set the iframe width to 766.7px (subtract .3 pixels). This seems to work in Firefox (subtracting 0.2 didn't work).
My question - what is going on here? Could this actually be a bug in Firefox? I know my iframe implementation is a little irregular, but I think the root cause may relate to this question which inspired my solution: Media query lost in Firefox when window resized to max-width minus scrollbar width