December 2007
Mon Tue Wed Thu Fri Sat Sun
« Nov   Jan »
 12
3456789
10111213141516
17181920212223
24252627282930
31  

Month December 2007

Background colors not printing?

Today I was working on a little report for work. So I designed a neat xHTML page that has some stats listed in a pretty little table, and then I realize people at work tend to print things out, so I better make a nice print style sheet. So I add my link tag: then started working on my print style sheet. Since I use CSS for all the layout all I really need to do is a few of things.

  • Remove the non-relevant section such as the page header
  • Adjust the browser defaults:
    • Remove coloring and underlines from links
    • Remove dotted border from abbreviations
    • Set my logo image to display as block
  • Restyle the table so that alternate rows are different colors
  • Add some Javascript to make the link’s url visible

So after doing all these I’m try to do some test prints. In Firefox and Opera everything is fine. Then in Internet Explorer 6 the background color for the alternate table rows isn’t printing. So I’m thinking it’s some sort of IE bug. After spending some time fiddling with the CSS I noticed that which ever element I applied a background color to it wouldn’t print.

Then it hits me… The browser preferences. If you go to the file menu and choose Tools << Internet Options A window will open. Choose the tab called Advanced. Then scroll down to the printing section and check the option “Print background colors and images”. See Figure 1.

Figure 1

Once you’ve done this your background colors will print.

I also noticed this happens in Safari for Mac. The preference to change this lives in the print dialog. Once your in the print dialog box, expand the dialog by pressing the upside down triangle thing next to the printer you’ve selected.

Figure 2

Then check the box that says “Print Backgrounds”. See Figure 3.

Figure 3

As a web designer it reminds me that you can’t depend on anything so make sure that your print style sheets do not depend on background colors. For example what if you wanted to have some light grey text or white text on a background color, well if the user has their background colors unchecked, which by default it is, the white text will be printing on white paper. Not good. I guess the lesson here is to test, test, and then do some more testing to make sure everything is working.

24 Ways: Web Design Tips and Tricks

Every year (since 2005) 24ways.org brings you a web design/dev article each day for twenty-four days leading up to X-Mas. The articles are written by “thought leaders” in the web design/dev community. Some of last year’s article were written by Jeremy Keith, Dan Cederholm, Andy Budd, Shaun Inman and others. Today (Dec. 1) was the launch of 24ways 2007 so check it out.

read more | digg story