I have several simple web pages that contain a similar layout. All these pages are embedded in a bigger product within iframe, to keep them independent. Since the iframe can be resized in any way and expanded, can go fullscreen and so on, the page should adapt to it. The chosen solution was to rescale the whole content, as it makes it dramatically simple to create (and media-queries wouldn't work).
I have noticed however a problem when testing on Firefox (v68 x64). When I scale down divs with borders, at some point the borders are scaled inconsistently. Different sides of the divs will either show or not any border. The resulting effect is horrible, and I noticed that this does not happen with other browsers (not even IE11 :D).
I prepared a little jsfiddle to show what happens: jsfiddle
.container {
width: 400px;
height: 400px;
background: black;
transform-origin: 0 0;
padding-top: 30px;
transform: scale(0.4);
}
.btn {
border: 2px solid white;
margin: 20px 30px;
height: 50px;
color: white;
line-height: 50px;
padding-left: 20px;
}
<div class="container">
<div class="btn">Btn 1</div>
<div class="btn">Btn 2</div>
<div class="btn">Btn 3</div>
</div>
This happens when I downscale a div that contains other divs with borders. In this example the second button appears to not have a top-border.
I obviously don't expect all pages to scale down indefinitely and still look good, just have consistent borders that do not disappear. In other browsers it works much better. Does anybody know how this problem could be solved/improved? I am not able to change the underlying conditions (scaling requirements, embedding the page), but I have full access to the page itself and I'm able to change it.
Let me know if you require more details (e.g. Screen details, default page resolution...etc).
NOTE: The suggested duplicate has nothing to do with this issue, while the problem "looks similar", a quick read would show that the browser in question is different, the basis of the problems are completely different, and going further, none of the solutions work.