css - How to forcefully print background image in HTML? -


i need print report page has couple of background images on it. these images not printable. these images logos graph , hence important in report.

i have option can crop them , include in page tag last option. hence before know if there way forcefully print these images? can me out?

by default, browser ignore background css rules when printing page, , can't overcome using css.

the user need change browser settings.

therefore, image need print should rendered inline image rather css background. can use css display inline image print though. this.

html

<div class"graph-image graph-7">   <img src="graph-7.jpg" alt="graph description" /> </div> 

css

.graph-7{background: url(../img/graphs/graph-7.jpg) no-repeat;} .graph-image img{display: none;}  @media print{   .graph-image img{display:inline;} } 

using code, or similar code, means image used once in html , once in css. html version hidden using css, , print displays normal. hack, want do. print image.

having said that, you're doing terribly bad practice. nothing conveys meaningful information user should conveyed using css alone. not semantically incorrect, makes graph less useful users. inline image better, , if can, that's should use.


Comments

Popular posts from this blog

c# - SVN Error : "svnadmin: E205000: Too many arguments" -

c# - Copy ObservableCollection to another ObservableCollection -

All overlapping substrings matching a java regex -