0

I have HTML + CSS page that contains img element with background image in CSS.

In HTML:

<img class="symbol>

In CSS (Sass):

.symbol{
   background-image: url('../images/symbol.png');
   background-repeat: no-repeat;
   width: 50px;
   height: 50px;
   background-position: 15px, 15px;
}

It is shown correctly in Chrome but on printing (ctrl + P) its automatically remove the background but I need the image background also in the printed page.

How can I fix it?

j08691
  • 204,283
  • 31
  • 260
  • 272
haya
  • 487
  • 3
  • 7
  • 20

1 Answers1

1

If you add

@media print {
  .symbol {
    background-image: url('../images/symbol.png');
  }
}

to your CSS your background image should show up while trying to print the page. If you still can't see it Chrome provides a few options on print page one of them being Background graphics, check it and your image should display.

Chrome Print Page - Background graphics option highlighted

erikvimz
  • 5,256
  • 6
  • 44
  • 60