Print.css and your website’s logo

Every website needs a print style sheet, especially informative websites. I thought about a little trick, to give you printed page the logo and/or url, or whatever picture you would like to see on the printed paper.

Preparation

Make a image in Photoshop that you want to be printed. You can use your company logo and/or the url.

Integration

1. At the print.css somewhere between the <head>-tag
<link href="/css/print.css" rel="stylesheet" type="text/css" media="print" />

2. Insert this code in your html/php/aspx/… file:
<div id="print-logo"><img src="/img/YOUR-IMAGE.gif" alt="Whatever" /></div>
OR a better solution is <img src="/img/YOUR-IMAGE.gif" alt="Whatever" id="print-logo" /> (thanks Nathan)

You can place this code wherever you want, I prefer after the <body>-tag of before the </body>-tag. This way, your logo will be presented at the top or bottom of your entire content.

3. Insert this code in your general style sheet:
#print-logo {display:none;}

4. Insert this code in your print style sheet:
#print-logo {display:block;}

Result

If someone prints your webpage, your logo and/or url is displayed on the printed page. Here are some examples that I made:

Google
Yourwebsite
Ess
Icons

You can find a lot of free icons on the web, check the post of Smashing Magazine “Freebies Round-Up

If you define your print style sheet, don’t forget to define your body tag font size and font family. It’s more fun to read Tahoma or Arial, then Times New Roman.

Only print what is necessary. Navigation, footer or header are necessary in your website, but when you print a webpage, you only need the important content parts.

This entry was posted in CSS by Sibran. Bookmark the permalink.

About Sibran

he Name Sibran is a boy’s name. The origin of the baby name Sibran is Breton with the meaning(s) depending on Gender/Origin being Breton- From Cyprus. Sibran has the following similar or variant Names: Sybran. I am a multimedia developer specialized in HTML/CSS, web 2.0, web standards, Google Custom Search, Search engine optimization. I like the blue water between the big islands with all his/her mysteries, it’s the only place in the world that is still unknown… and because that’s the only place where it never rains.

16 thoughts on “Print.css and your website’s logo

  1. I actually do this already, but be aware that the image(s) will also appear on your page if viewed with CSS turned off. In my case the branding appears as css background images so it is a desirable thing to have the substitute show when CSS is disabled.

  2. Yes indeed, that’s exactly the way I work. The brand logo is in the css background, mostly with an “a-tag displayed blocked” around it to keep it linked.

    If css is disabled, the branding logo of the printing ID will be displayed.

  3. Did you read my post? :)
    That’s what my post is all about, using an image for printing, but not showing in your html…

    You could position your websites logo as in image in your html, but from time to time, you don’t have the opportunity that your logo is at the top or bottom of your page. That’s why I wrote this article about.

  4. Like dave said above. If the user has css disabled your image will show up. A better solution if your layout will allow it is just to simply have your logo in an image field in the header where it will appear when printed.

    However, if your layout doesn’t allow and for use of this technique there’s no real need for the extra div tag that I can think of. Alls the extra div tag does is adds to your markup.

    You could simply tac-on a id or class tag onto the image and simply use something on the lines of img#print-logo {display:none;}, img.print-logo {display:none;}

    Cheers

  5. Pingback: Nachlese Oktober 2007 - Die Seiten des Monats | Nachlese | Dr. Web Weblog

  6. Pingback: Best Of October 2007 | Best of the Month | Smashing Magazine

  7. Pingback: Best Of October 2007 | Blog

  8. Pingback: Ess - Sibran Lens » Blog Archive » The best of October 2007 by Smashing Magazine

  9. Pingback: { Studio Rhoad } Media Design & Photography» Blog Archive » Best Of October 2007

  10. Your company logo should probably be in your HTML and not as a CSS background image because it’s content, not decoration. That way you don’t have to bother about changing its display depending on whether its for the screen or print. You can still put an image in a hx tag if it needs it and give it appropriate alt text for those who have images off.

  11. Pingback: 2007年10月小结 | mashableCN

  12. Pingback: 行搏客 » Smashing Magazine 2007å¹´10月最佳

  13. Forgive me for coming into this conversation late, but mine is an end-user problem that I have never as a self-confessed amateur been able to suss. It would be best for me to just ask the Q’: What, if any, is the best format to use when saving a graphic, i.e., logo, for sending across, say, a network that will always be printed perfectly…or at least resemble the logo while not throwing up any pixilation? If anyone is still concerned with this, an explanation would be appreciated. Thanks, Kai

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>