My question is a little complicated, as it revolves around a bigger layout/theme and how that theme behaves with different screensizes.
Using the original Sugarcube 2 theme, i wanted to create 2 image banners, one to the left of the original #passage and one to the right.
whilst this was perfectly possible, appearantly the layout doesn't end up the correct way on other monitors, even some with the same resolution of 1920x1080.
This is despite using percentage values for assign width, height, margin etc.
here is the code (its long, please bear with me):
For the Image-Bar (this is the image bar between the UI and the main passage, the one to the left of the main passage and to the right of the UI bar)(i'm including the code for when the UI bar is stowed):
#image-bar {
position: fixed;
z-index: 1;
background-color: rgba(0, 0, 0, 1);
width: 16%;
height: 100%;
bottom: 0.1%;
top: 0.1%;
margin-left: 14.5%;
padding: 1%;
padding-right: 2%;
transition: left .2s ease-in;
}
#ui-bar.stowed~#story {
margin-left: 10em;
}
#ui-bar.stowed~#image-bar {
margin-left: 1.5%;
}
For the Right-Bar (this is the image bar all the way to the right, which is to the right of the main passage)
#right-bar {
position: fixed;
z-index: 1;
background-color: rgba(0, 0, 0, 1);
width: 16%;
height: 100%;
left: 82%;
bottom: 0.1%;
top: 0.1%;
padding: 1%;
transition: left .2s ease-in;
}
After this, both Image bars are appended to the main document body.
$('<div id="image-bar"></div>').appendTo(document.body);
$('<div id="right-bar"></div>').appendTo(document.body);
The problem is, that sometimes, the #Image-Bar (the one on the left) either gets hidden under the UI-bar (or over, depending on the z-index value). The #Image-Bar does not stick properly to the UI-bar, and also sometimes goes over into the passage, hiding the text at lower resolutions/when minimized.
Is it possible to squeeze the #passage first when making the window smaller, making the test fit the new window size, whilst also avoiding that the #Image-Bar hides behind the UI-bar?