Bootstrap print CSS removes background color

后端 未结 7 1562
[愿得一人]
[愿得一人] 2020-11-28 12:47

When I use bootstrap, it removes the background color from everthing when I try to print my page. Almost everything on my website is using bootstrap classes so I want to avo

7条回答
  •  爱一瞬间的悲伤
    2020-11-28 13:21

    @Vino explained really well. I was also facing problem because bootstrap.css makes background transparent forcefully. Thus I have customized the specific element in my custom CSS file. Remember to change <.element> with element where you want the colorful background instead of transparent.

    @media print {
    	 .element{
    		background-color: white !important;
    		box-shadow:  inset 0 0 0 1000px #fff !important; /* workaround for IE 11*/
    	 }
     } 

提交回复
热议问题