开发者

Mozilla Print Preview

开发者 https://www.devze.com 2022-12-12 19:28 出处:网络
i had created one web page with header image (style=\"background-repeat: repeat-x;\"). I have need print this page. Then print preview click and i see 2 pages. first page top position include header i

i had created one web page with header image (style="background-repeat: repeat-x;"). I have need print this page. Then print preview click and i see 2 pages. first page top position include header image and then 2 page is same header image开发者_StackOverflow社区s included, but i need only first page with header image, 2 page don't need header image. please help me


Unfortunately, that's how Firefox function, each new print page is like an individual web page.

I would recommend you use a "print" specific CSS by removing the body background and having a block header visible only in print.

Here's an example:

<html>
<head>
<style type="text/css">
body {
    background: url(topbg.jpg) repeat-x;
}
div#printheader { /* Do not display for other non-print media */
    display: none;
}


@media print { /*CSS for print*/
    body {
        background: none;
    }
    div#printheader { 
        display: block;
    }
}
</style>
<body>
<div id="printheader"><img src="topbg.jpg" /></div>
.
.
.
.
.
</body>
</html>
0

精彩评论

暂无评论...
验证码 换一张
取 消