From this question I got a very nice code to render an A4 sheet onto my web app. I adapted it to fill up my needs. Here is the code snippet :
.book {
margin: 0;
padding: 0;
background-color: #FAFAFA;
font: 12pt "Tahoma";
}
* {
box-sizing: border-box;
-moz-box-sizing: border-box;
}
.page {
display: block;
width: 21cm;
height: 29.7cm;
margin: 1cm auto;
border: 1px #D3D3D3 solid;
border-radius: 5px;
background: white;
box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
}
.subpage {
margin: 1cm;
width: 19cm;
height: 27.7cm;
outline: 0cm #FAFAFA solid;
}
@page {
size: A4;
margin: 0;
}
@media print {
.page {
margin: 0;
border: initial;
border-radius: initial;
width: initial;
min-height: initial;
box-shadow: initial;
background: initial;
page-break-after: always;
}
}
<div class="container-fluid">
<div class="book">
<div class="page">
HEADER
<div class="subpage" id='editor-container'>CONTENT</div>
</div>
</div>
</div>
This code is very nicely rendering what I want to do on a computer screen. But when you use it on a small-sized screen, for example a tablet, this isn't very convenient.
How can I make this code responsive to suits the screen where it would be displayed ?
Basically, it would be nice if the sheet resizing to be entirely displayed on the screen, or at least from the left to the right side and users could scrolldown to display the content from the top to the bottom.