Treehouse: Grow your CSS skills. Land your dream job.

Getting a Background to showup on Print

  • # November 16, 2009 at 12:33 pm

    I have a PNG that has white text in it, so I need to put a background color on the img. However, it seems that the user stylesheet in your brwser overrides all of the backgrounds in your CSS on print. Does anyone know a way around this?

    I’ve tried this so far:

    .printElement { display: block; width: 100%; background-color: red !important; }

    The server is creating the image, so I can’t put the background in the image.


    # November 17, 2009 at 3:33 am

    I haven’t found how to make background images print.

    Have you tried creating a Print CSS file? It’s worth a try…

    # April 20, 2010 at 8:55 pm

    After much searching, I’ve found nothing. The browser strips out backgrounds by default and there isn’t a way to override it.


Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.