I want to add a print button to enable users to print my web page. However when I print all the css styles are lost. It seems the printer only keeps the basic html elements. If I also want to print out the page exactly as it looks like in a browser, what should I do? I mean if I use a color printer it will print a colorful page with css styles on it. When I use a black and white printer it should print light colors as white and dark colors as grey or black.
+1
A:
If you have media="screen"
on your link
element, try to remove it or replace with media="all"
.
floatless
2010-08-02 04:37:31
A:
CSS style-sheets have an attribute media
. It specifies to what media this css is applicable. Possible media types are listed here.
<style type="text/css" media="all">
@import "myCss.css";
</style>
OR
<link rel="stylesheet" type="text/css" media="print" href="print.css">
Ankit Jain
2010-08-02 04:37:47