For my sites, I want to use the print function of internets navigators, all the elements are printed except the background-image body and the color of html buttons.
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
Member
52 Points
189 Posts
printing background-image body html page error
May 02, 2017 10:34 AM|Rednuts72|LINK
Helllo,
For my sites, I want to use the print function of internets navigators, all the elements are printed except the background-image body and the color of html buttons.
Thanks you for your help !
M.A.
All-Star
31362 Points
7055 Posts
Re: printing background-image body html page error
May 02, 2017 12:22 PM|kaushalparik27|LINK
Try setting -webkit-print-color-adjust: exact; for body background image: printing - How can I force browsers to print background images in CSS?
css - Background color not showing in print preview
[KaushaL] Blog Twitter [MS MVP 2008 & 2009] [MCC 2011] [MVP Reconnect 2017]
Don't forget to click "Mark as Answer" on the post that helped you
Star
8670 Points
2882 Posts
Re: printing background-image body html page error
May 04, 2017 02:06 AM|Cathy Zou|LINK
Hi Rednuts72,,
By default, a browser will ignore background css rules when printing a page, and you can't overcome this using css.
The user will need to change their browser settings.
Therefore, any image which you need to print should be rendered as an inline image rather than a css background
For more information. please refer to the following links:
http://stackoverflow.com/questions/11242991/how-to-forcefully-print-background-image-in-html
http://stackoverflow.com/questions/5949897/how-to-get-a-background-image-to-print-using-css
http://www.seifi.org/css/how-to-force-css-background-images-to-print-in-web-browsers.html
Best regards
Cathy
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
Member
52 Points
189 Posts
Re: printing background-image body html page error
May 08, 2017 07:25 PM|Rednuts72|LINK
Hi,
I'm trying to use an img control inside a div and the printing of image as background is ok.
Best regards !