473,770 Members | 2,137 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

No background colors on print stylesheet

I have a set of pages with a special stylesheet used to override some
styles for printing. One of the things I've tried to do is reverse
the colors of my navigation. On the screen, I have a black background
and the navigation is red on yellow. For print, I (obviously) have a
white background and wanted the navigation to be reversed (yellow on
red) for better clarity.

I've done print preview in IE 6, Opera 7.5, and Netscape 7.1 (all
Windows) and see the text is yellow and the background is completely
absent. Does the "print" media not recognize background colors?

You can find a page here:

http://home.hiwaay.net/~lkseitz/cvg/pmf2/index.shtml

and the stylesheets here:

http://home.hiwaay.net/~lkseitz/cvg/pmf2/pmf.css (media="all")
http://home.hiwaay.net/~lkseitz/cvg/pmf2/print.css (media="print")

I'm aware the HTML doesn't quite validate, but the problems are from
the Nedstat code at the bottom of the page that I can't modify too
much if I want it to work. It should have no bearing on the
navigation areas.

--
lkseitz (Lee K. Seitz) .at. hiwaay @dot@ net
"There are obviously many people who prefer one brand of bulls**t to
another, but I am not among them."
-- Tom Lehrer on whether he has a religious preference
Jul 20 '05 #1
5 4635
Lee K. Seitz wrote:
I have a set of pages with a special stylesheet used to override some
styles for printing. One of the things I've tried to do is reverse
the colors of my navigation. On the screen, I have a black background
and the navigation is red on yellow. For print, I (obviously) have a
white background and wanted the navigation to be reversed (yellow on
red) for better clarity.

I've done print preview in IE 6, Opera 7.5, and Netscape 7.1 (all
Windows) and see the text is yellow and the background is completely
absent. Does the "print" media not recognize background colors?


Yes it does. But perhaps you set your browser not to print backgrounds
colors.
Matthias

Jul 20 '05 #2
lkseitz (Lee K. Seitz) .at. hiwaay @dot@ net wrote:
I have a set of pages with a special stylesheet used to override some
styles for printing. One of the things I've tried to do is reverse
the colors of my navigation. On the screen, I have a black background
and the navigation is red on yellow. For print, I (obviously) have a
white background and wanted the navigation to be reversed (yellow on
red) for better clarity.
Why do you want your navigation to print at all? I've never been able
to click on a link on a print out and have anything happen. :-(
I've done print preview in IE 6, Opera 7.5, and Netscape 7.1 (all
Windows) and see the text is yellow and the background is completely
absent. Does the "print" media not recognize background colors?


Most browsers have an option to "print background colours", and most
browsers have this option set to off by default.

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <st***@pugh.net > <http://steve.pugh.net/>
Jul 20 '05 #3
In article <2h************ @uni-berlin.de>,
Matthias Gutfeldt <sa************ @gmx.net> wrote:
Lee K. Seitz wrote:
I've done print preview in IE 6, Opera 7.5, and Netscape 7.1 (all
Windows) and see the text is yellow and the background is completely
absent. Does the "print" media not recognize background colors?


Yes it does. But perhaps you set your browser not to print backgrounds
colors.


Bingo! Additional reading revealed this. Apparently I'd configured
it to do so at home and forgotten about it. The browsers above are
just recently installed on a new computer and have not had most of the
preferences set yet. Thanks.

I may just do away with the navigation on the printed version
entirely. I guess there's no logical reason to leave it there.

--
lkseitz (Lee K. Seitz) .at. hiwaay @dot@ net
This quote appears by decree of Michael D. Hensley:
"But I'm not in anyone's .sig."
-- Vicki Robinson
Jul 20 '05 #4
Lee K. Seitz wrote:

I may just do away with the navigation on the printed version
entirely. I guess there's no logical reason to leave it there.


Generally yes, there's no point to it. But there might be situations
where it's useful to have a "TOC" on the paper printout, as a reminder
to the reader that there's additional information available (OK, so the
smart reader will remember that, but hey, I'm not smart...).
Matthias

Jul 20 '05 #5
Lee K. Seitz) .at. hiwaay @dot@ net wrote:
I have a set of pages with a special stylesheet used to override some
styles for printing. One of the things I've tried to do is reverse
the colors of my navigation. On the screen, I have a black background
and the navigation is red on yellow. For print, I (obviously) have a
white background and wanted the navigation to be reversed (yellow on
red) for better clarity.

I've done print preview in IE 6, Opera 7.5, and Netscape 7.1 (all
Windows) and see the text is yellow and the background is completely
absent. Does the "print" media not recognize background colors?


E.g. IExplorer may ignore your background set in the print CSS. That's
a default setting to save ink I guess...

--
Google Blogoscoped
http://blog.outer-court.com
Jul 20 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
8684
by: Scott | last post by:
There is a setting in IE for "Print background colors and images." I've noticed that without checking this option, a web page will print CSS lines between table rows, but a background color of say the header won't. The below style will display the borders in print preview, but won't display the background color. Does anyone know if it's possible to force background CSS or HTML colors to print without having the user change the default...
3
37219
by: Felix Natter | last post by:
hi, is there a way (html/css/javascript) to force IE to print background-colors exactly as specified in html/stylesheets? I tried to use @media print { ... } to override IE's "print background colors + images" option, but it doesn't work. Any other idea? I'd like to avoid relying on the user for setting this option.
25
12945
by: Neal | last post by:
According to the CSS lint at http://htmlhelp.org/tools/csscheck/, "The shorthand background property is more widely supported than background-color." Can anyone point me to, or provide, information on what browsers have difficulty with the non-shortcut methods of setting background properties?
3
5529
by: Vam | last post by:
Hi, My program makes an HTML report which needs to be easily printable. On this report is a table, and one of the columns in the table needs to express a color. I've done this by setting the background of the cells in that column to their colors (which differ from row to row), but those background colors don't print unless a certain option is set in IE, which is apparently off by default. The way we've figured around this is to add a...
16
3939
by: J. B. Moreno | last post by:
I read the faq, and it mentions that IE 4 on windows requires setting a printing option to allow background colors to be printed. Things change, life goes on, other browsers come into existence.... So, is there a way in CSS to say "Yeah, print these background colors", without the user having to turn on an option that will then apply to all pages printed? Thanks,
6
1936
by: Mark | last post by:
Hello all - I'm trying to incorporate a stylesheet into an ASP.Net page but everytime I include the "LINK" code to the .css file in the HEADER location of the HTML code, the background color that I have set (which is blue) gets changed to white. Below is my code in the HTML of the ASP.NET page and then my code in the .css file. Any help is sincerely appreciated as I haven't worked with stylesheets alot in my past. Thanks for any...
4
2154
by: Lachlan Hunt | last post by:
Hi, I'm looking for an interoperable method of determining the current background colour of an element that is set using an external stylesheet. I've tried: elmt.style.backgroundColor; but that only works if the colour has been set using the style attribute or previously set using script. I've also tried:
10
7733
by: Bob Bedford | last post by:
I've a table in wich I've this CSS: ..oddrow{background-color:#FFFFFF} ..evenrow{background-color:#CCCCCC} The oddrows are white and the even are grey. BUT ! when I do print the table, there is nothing !!! How to print such lines colors ? the main purpose of this table is to be
4
1538
by: devphylosoff | last post by:
hi folks I am looking for a tool (script, plugin, code, ...) which can generate background image for webpage look at background on http://vtorrent.info/ page or on the Vista webpage. I want to create this in fly - only give two colours and expect result which will be created by function.
0
9619
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10260
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10102
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10038
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8933
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6712
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5482
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4007
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3609
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.