My purpose is to print the contents vertically while printing a file. But before I do this, I will write the following "html, body" tags to download the page to 1, I applied the following question-and-answer styles. Then, when I simply say "margin: 50% auto", this function does not work the way I want it to. When I try to change the content of the "html, body" tag, the number of pages can be 2,3 instead of 1. I thank you for your help.
Note: I'm try to center of body this element =>"#containerDiv"
html,
body {
width: 210mm;
height: 50mm;
padding: 0 !important;
margin: 0 !important;
overflow: hidden;
border: 1px solid black;
display: table;
}
#containerDiv {
margin: 50% auto;
}
<div style="background:blue" id="containerDiv">
<div style="background:red; height:200px;width:200px;" id="innerDiv"></div>
</div>