Forum Moderators: not2easy
<Sorry, no URLs. See TOS [webmasterworld.com]>
Please enlighten! Thanks.
[edited by: tedster at 5:44 am (utc) on Jan. 28, 2004]
There is nothing you can do about this, since the browser behavior depends on a browser setting (which makes backgrounds print or not print).
There was a similar thread about this in the HTML and Browsers forum: [webmasterworld.com...]
In my screen stylesheet I've specified a body background image. When the page is printed I want that background image to be gone altogether, so I removed the body background image from the print stylesheet. Netscape and IE treat this situation logically, they print no background image, but Opera prints the background image from the screen stylesheet!
And yet every other style in the print stylesheet is displayed (or not displayed) correctly.
So to clarify, I don't want the background image to appear in prints, which is why I didn't include it in my print stylesheet. But Opera goes and gets it anyway, from the screen stylesheet.
I had been using "background-image: none" in my print stylesheet, but since the results made no sense to me I created the simple test files that I linked to in my original post. That way I could easily see what the browser was doing when I clicked print preview. Netscape and IE showed the "print" background, but Opera showed the "screen" background.
body, html { blah blah }
...instead of:
body { blah blah }
So do a print preview in Opera and the "body background image for print" now appears as a background beneath the <p> tags in the body area, while the "body background image for screen" appears everywhere else (outside the <p> tags).
In Netscape and IE the "body background image for print" also appears as a background for <p> tags.
I've reduced the HTML page and the CSS file to the bare essentials, you could create them yourselves in moments. The stylesheet has "@media screen" styles and "@media print" styles. The <body> tag for screen contains a background image, the <body> tag for print contains a different background image. The <p> tag is the same for screen and print, except the font size is different (which allows me to confirm that the print styles are being read at all).
Can anyone can show me an example they've done in which the body background is displayed correctly for print? I'd love to see it. Otherwise I'm going to give up on Opera for the moment and hope they fix this bug in later versions.