I need to print a html document. This document contain multipage table. Now, I need a way to add an banner image at page-top on every page. I have tried with 'position:fixed', but this procedure overlaps my table rows. I would be really grateful if anyone help me to find a solution.
Thanks in advance.
@media print{
body div img{
position: fixed;
}
}
You could try adding the image and hide it with display:none
or other styles. And then in media print, show it with for ex display:block
. That way it will be before the table ( or where you want it )
img { display: none } @media print { img { display: block } }
<img src="http://via.placeholder.com/350x150"> <table> <tr> <td>table</td> <td>table</td> </tr> <tr> <td>table</td> <td>table</td> </tr> <tr> <td>table</td> <td>table</td> </tr> </table>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.