开发者

How to print background images/styles without tweaking the browser page setup?

开发者 https://www.devze.com 2022-12-18 20:17 出处:网络
Is there any way to print out something like, when the user Prints out the page? <div id=\"test\" style=\"background:#000000; color:#FFFFFF\">Black Stripe</div>

Is there any way to print out something like, when the user Prints out the page?

<div id="test" style="background:#000000; color:#FFFFFF">Black Stripe</div>

I'm trying to create a page with row striping in the printout the same way it appears on screen. When they go to print, it of course drops the background.

Besides telling each user how to enable print backgrounds in their b开发者_如何学JAVArowser, is there a way programmatically via CSS, HTML or JavaScript to do this?


Nope, that's completely dependent on the browser's settings that you can't change with JavaScript or CSS.


The only way is to have images behind your rows.


I haven't tried, but perhaps setting a style sheet for printers?


If you use internet explorer this is sure gonna work

  • go to 'tools menu'.
  • click on 'internet options'.
  • click on advanced tabs.
  • put a check on print background color and images.
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号