Jump to content

printer problem


niche

Recommended Posts

I can display and print boxes with my printer using the img tag, but I'm concerned about slow loading times especially when I load many images So, I used the div tag to create an assortment of colored boxes on my browser, but they won't print on my printer using firefox.So, I used the table tag to create an assortment of colored boxes on my browser, but only the border prints without any color on my printer using firefox.If I need the browser to quickly render boxes and be able to print them (in color) using my printer, what's the best tag to use?Thanks

Link to comment
Share on other sites

The media attribute of the link tag can be used to indicate the CSS is for print.<LINK rel="stylesheet" media="print" href="corporate-print.css" type="text/css">http://www.w3schools.com/TAGS/att_style_media.asphttp://www.w3.org/TR/REC-html40/present/styles.html#h-14.4.1http://www.w3.org/TR/CSS2/media.html#media-sheets

Link to comment
Share on other sites

I scripted this based on what I read, but print preview still not showing a green box. <div style="width:345;height:250;background-color:green;" media="print"</div>What did I miss?Thanks

Link to comment
Share on other sites

Most browsers don't print backgrounds by default. You can change that in the browser settings (e.g. in Firefox, change the print.printer_<printer name>.print_bgcolor option to true).

Link to comment
Share on other sites

You're referring to a firefox option not a scripting option right?

Link to comment
Share on other sites

Yes; there is no way to change browser options from a web page. If you want it to print when a browser is set to not print backgrounds, you have to use something else.If it's just a single color, you could have a really small image and just resize it.

Link to comment
Share on other sites

Thanks to wirehopper and Synook for their help.Niche

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...