Forum Moderators: not2easy

Message Too Old, No Replies

Forcing a "background" color to print

It really is a foreground, kind of....

         

photon

3:18 pm on Jun 19, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I've created dynamic bar charts using CSS:
.bar {position:absolute; left:0px; background:#022B7F; color:#FFF;}
.chart {position:relative; width:18%; background:#AAA; border:solid 1px #555; vertical-align:middle;}

The inline style then determines the length of the bar:

<span class="chart"><span class="bar" style="width:XX%"></span></span>
[1]where XX is a calculated percentage.[/1]

This works quite nicely on screen. The issue is with printing. Since the

.bar
style uses a background color, and since most people have the "Print background" option turned off in their browsers, the bar does not print.

I'm feel pretty safe in guessing that there no way to turn on the user's background printing. Is there a way in CSS to get a solid color "foreground"? I think I could just use a 1 pixel wide image instead (need to play with that), but I'm wondering if there's another way.

Thanks for your help.

DrDoc

4:54 pm on Jun 19, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Well, then you might run into the problem with people not printing images.

photon

5:08 pm on Jun 19, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



True enough, but I would think that more people have "Print images" enabled.

Still, that's why I'm wondering if there's another way.

pageoneresults

5:12 pm on Jun 19, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



True enough, but I would think that more people have "Print images" enabled.

Unfortunately IE does not offer this option. It is either both, backgrounds and images, or none.

photon

5:55 pm on Jun 19, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Doesn't that option just apply to background images? For example, I don't have that enabled, but when I print this page I see the Webmaster World.com logo and all of the little credit card images.

DrDoc

6:11 pm on Jun 19, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you use divs (or transparent images) with borders you will still see the border, even if the color isn't printed.