Print background image in IE without enable “Print background colors and images”

前端 未结 1 1059
借酒劲吻你
借酒劲吻你 2020-12-06 12:18

Is possible to print a background-image whithout enabling \"Print Background colors and images\" in Advanced tab of Internet Options ?

I think to use a alternative w

相关标签:
1条回答
  • 2020-12-06 12:50

    The ability to print background images (those images specified as background-images in the markup) is entirely up to the end user, you can not control this programmatically from your code. There is a plugin for Firefox that provides a JavaScript API to control many print settings - this might be able to control background-images. However, this obviously only works in Firefox and is dependent on the end user having this particular plugin installed.

    You could use absolutely positioned IMG tags and manage the z-index of layered containers to push the IMG to the back, but TBH it's starting to get messy and you may not be able to achieve the affect you are after and maintain correct semantic markup. Certainly if you want the IMG to repeat you'd have to resort to JavaScript to create and position multiple IMG tags, or create one large image that you have manually tiled - not recommended.

    Unless you have a specific requirement, users generally do not want (or need) background images to be printed - hence the easy reach option in the browser. So it may be best to rethink the problem. Print and screen are two very different media so you shouldn't necessarily try to mimic on screen display in print, hence CSS's ability to create print only stylesheets - if that is what you are trying to achieve?

    0 讨论(0)
提交回复
热议问题