Problems with background printing using bootstrap in Firefox

0

Good afternoon, friends,

I do not have much practice with Bootstrap yet, I could not figure out a way to maintain the background of a div, when I print a page through window.print ()

I have the following code:

<div class="qCor" style="background-color: #752740 !important;">

On Screen

Butwhenyouprintfromthebrowser,thedivbackgroundisblank.

Any suggestions how can I deflect this problem?

    
asked by anonymous 08.03.2017 / 19:41

2 answers

1

I made tests here in chrome and saw that it prints without the backgrounds when the background graphics option is disabled.

It is on the screen that you will confirm the print, choose printer or PDF, etc. click on Mais configurações will be the last option (in my browser it is background graphics ).

doing via CSS: you will not be able to reach all browsers

.suaClasse{
    -webkit-print-color-adjust: exact; /*funciona no chrome e opera*/
    color-adjust: exact; /*funciona no Firefox*/
}

    
08.03.2017 / 19:54
0

Oops, I found a solution.

I modified the style following Douglas's suggestion.

style=" -webkit-print-color-adjust: exact !important; color-adjust: exact !important; background-color: #752740  !important;"

This is working in both Chrome and Firefox.

Thanks for the comments.

    
08.03.2017 / 20:13