How to Print Background Images Generated by ASP.NET Sprites in Different Browsers?

Patricia Arquette
Release: 2024-10-26 10:23:02
Original
999 people have browsed it

How to Print Background Images Generated by ASP.NET Sprites in Different Browsers?

Printing Background Images with CSS

Problem:

ASP Net Sprites generated CSS Sprites are not printing. The generated HTML code includes tags with base64 encoded data, rendering the images invisible at print.

Solution:

For Chrome and Safari:

<code class="css">@media print {
    * {-webkit-print-color-adjust:exact;}
}</code>
Copy after login

This CSS rule forces Chrome and Safari to print background images as intended, regardless of their source.

For Other Web Browsers:

Unfortunately, for other web browsers, users must manually enable background image printing. For example, in IE 9, 10, and 11, users must:

  1. Click the cog icon (Print Settings)
  2. Select "Print"
  3. Click "Page Setup" and activate the option to "Print Background Colors and Images"

The above is the detailed content of How to Print Background Images Generated by ASP.NET Sprites in Different Browsers?. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!