Zoe M. Gillenwater wrote:
This is a fix for overriding a background color set on the body, correct, but there is no workaround for backgrounds on other elements, like a container div? This is a ridiculous bug but not one I'm very worried about, but I want to make sure I'm understanding you correctly.

Zoe, I don't think that normal divs are affected by the bug. Its the body and html bg-color, when I am not wrong.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>

<style type="text/css">

@media screen {

  /* switch */
  /* html {background-color: maroon;} */

  body {background-color: red;}

  div#bg {background-color: blue}
}

@media print {
        body {
                background: olive;
                border: 5px solid fuchsia;
                }
        html {background: yellow;}
        }
}

</style>
</head>

<body>
  <div id="bg">Hello</div>
  <div>World</div>
</body>
</html>

Compared with Firefox set to print backgrounds, Opera does it wrong.

In print preview,

- the screen-body-bg overwrites the print-html-bg and the print-body-bg

But if the screen-html-bg is set,

- the print-body-bg is respected, but not the print-html-bg

Sorry, this is beyond my understanding. Better try for yourself, maybe I'm overlooking the obvious. The bug is reported [1] a while ago.

A version of our haslayout-article was white font on dark gray background, resulting in a cool, but somewhat inaccessible print effect (black font on dark gray) -- by default in OP8 PC/Mac.

We played with the order of the style sheets and with !important with no avail.

So we came up with this "fix", alternatively, one could set an explicit white background for a pagewrapper in the print style sheet.

Ingo

[1] http://my.opera.com/community/forums/topic.dml?id=87971

--
http://www.satzansatz.de/css.html
______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to