Hello, my dears. I have a question. How do I do that so that the text is in the middle and not at the top in the print preview, and I can't even manage the line spacing. Am I doing something wrong or is it something to do with osclass itself?
<style>
@media print {
#print {
min-height: 10em;
display: table-cell;
vertical-align: top;
position: relative;
margin: 0;
position: absolute;
top: 50%;
left: 50%;
margin-right: -50%;
transform: translate(-50%, -50%)
}
.centered {
position: relative;
vertical-align: top;
top: 80%;
left: 50%;
transform: translate(-50%, -50%);
}
</style>
<script>
function printDiv(print){
var restorepage = document.body.innerHTML;
var printcontent = document.getElementById('print').innerHTML;
document.body.innerHTML = printcontent;
window.print();
document.body.innerHTML = restorepage;
}
</script>
<details>
<summary><h1></h1></summary><button onclick="printDiv('print')">Print</button><div id='print'>
<p><center><div><h1><?php echo osc_item_category() ; ?></h1></div></center></p>
<p style="line-height: 150%"><center><div><font size="5" style="display:table-cell; vertical-align:middle; font-weight:bold;"><?php echo osc_item_title(); ?></font></div></center></p>
<p></p>
<p class="centered" style="line-height: 150%"><center><div><p><span><font size="5" style="display:table-cell; vertical-align:middle; font-weight:bold;text-align: end; position: relative;"><?php echo osc_item_formated_price(); ?></font></span></p></div></center>