I want to generate a pdf of the layout. There will a fixed size for a div eg. The width of the div 720px and I want to maintain it 720 on all the devices. Since the div will go outside the screen on mobile devices I used to transform(scale) to make it small size but there is space below the div. I want to remove that space. below is the code for your reference.
.Scale {
background-color: #dddddd;
}
.blue {
background: blue;
}
.red{
background: red;
}
.Scale div {
width: 50px;
height: 50px;
}
.Scale {
transform: scale(0.5);
transform-origin: top left;
}
.parent{
border: 1px solid;
}
<div class="parent">
<div class="Scale">
<div class="red"></div>
<div class="blue"></div>
</div>
</div>
it's simple you have to calculate with height, If for some reason you turn it upside down! like here your current width: 500px; and height: 220px; you want to reverse it like width: 220px; height: 500px; then again you have to use margin-bottom: calc((0.6 - 1) * 500px); that's it.