Skip to content Skip to sidebar Skip to footer

Print Html With Images (every Image On Separate Page)

I have an HTML with images: While printing, I want every image to be on a separate

Solution 1:

You can try the following..

<html>
    <head>
        <style type="text/css">
            @media print {
                p.pageBreak {page-break-after: always;}
            }
        </style>
    </head>
    <body>

    <p class="pageBreak">
        <img id="1" src="http://placehold.it/250x250">
    </p>
    <p class="pageBreak">
        <img id="2" src="http://placehold.it/250x250">
    </p>
    <p class="pageBreak">
        <img id="3" src="http://placehold.it/250x250">
    </p>
    <p class="">
        <img id="4" src="http://placehold.it/250x250">
    </p>
    </body>
</html>

Post a Comment for "Print Html With Images (every Image On Separate Page)"