Michael Gaigg: Über UI/UX Design

8Sep90

Design Guidelines: Print Stylesheet

One of the most elegant techniques in web design is the use of a print stylesheet to control the style of a webpage on a hardcopy. Being so easy and cheap it is by far the most undervalued technique out there.
Often overseen bonuses are

  • adding copyright statements or thank you notes,
  • controlling which elements should not be seen (remove menu, commercials,...) and
  • in general ensure that the printed page is legible (contrast especially for links, fonts, ...).
Results of applying a print stylesheet to the page

Results of applying a print stylesheet to the page

Design Guideline for a Print Stylesheet

  1. Make page legible
    • Use serif font family (e.g. Georgia)
    • Use points (e.g. 12pt)
    • Ensure good contrast (e.g. color: #000; background: #FFF)
  2. Maximize paper use (e.g. width: 100%)
  3. Hide elements not relevant to print (e.g. display: none)
  4. Add content relevant to print (e.g. spell out links, thank you note)
  5. Use correct markup to reduce amount of styling (e.g. h1, h2,...)

How it works

Embed an extra stylesheet designed for print media into the page.

<link rel="stylesheet" type="text/css" media="print" href="print.css" />

This stylesheet takes effect when a user invokes the print function of the browser and overrules style elements in other stylesheets on the page.

Then either provide a button or link that triggers a javascript function to print the page or have the user go through the browser's menu, even print preview would show you the expected layout already.

<a href="#" onclick="window.print();return false;">Print page</a>

I know, evil javascript, but hey, if turned on it works cross-browser (except IE6 with multiple IE versions installed).

Code sample

I recognize that many samples can be found on the web but I also found them incomplete in many cases. I don't claim to be compete myself, but I really like with what I came up with and most of all would like to hear your comments and feedback or even better references or links where you applied it to.

Download sample code

index.htm

<html>
<head>
<style type="text/css" media="all">
@import "main.css";
</style>
<link rel="stylesheet" type="text/css" media="print" href="print.css" />
</head>
<body>
<div id="wrapper">
<div id="statement">Legal statement and thank you note.</div>
<div id="header">Header</div>
<div id="content">Content plus <a href="http://link.com/">Link</a></div>
<div id="footer">Footer</div>
</div>
</body>
</html>

main.css


/**
Elements
*/
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, font, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td {
margin: 0;
padding: 0;
border: 0;
outline: 0;
font-weight: inherit;
font-style: inherit;
font-size: 100%;
font-family: inherit;
vertical-align: baseline;
}
/* remember to define focus styles! */
:focus {
outline: 0;
}
body {
line-height: 1;
color: black;
background: white;
font-family: Arial, Helvetica, sans-serif;
}
ol, ul {
list-style: none;
}
/* tables still need 'cellspacing="0"' in the markup */
table {
border-collapse: separate;
border-spacing: 0;
}
caption, th, td {
text-align: left;
font-weight: normal;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: "";
}
blockquote, q {
quotes: "" "";
}
/**
Classes
*/
/**
IDs
*/
#wrapper {
background: #FFFFFF none repeat scroll 0%;
margin: 0pt auto;
width: 600px;
}
#header {
border: 1px solid #CCC;
margin: 5px;
padding: 5px;
}
#content {
border: 1px solid #CCC;
background: #EEE;
margin: 5px;
padding: 5px;
height: 200px;
}
#footer {
border: 1px solid #CCC;
margin: 5px;
padding: 5px;
}
a:link, a:visited {
border-bottom:1px dotted;
color:#AE4F0C;
font-weight:bold;
text-decoration:none;
}
a:visited {
color:#333333;
}
a:hover, a:focus {
border-bottom-style:solid;
color:#D03900;
}
a:focus {
/*background:#FFFFCC none repeat scroll 0%;*/
}
#statement {
display: none;
}

print.css


body {
font-family: Georgia, serif;
background: #FFF;
color: #000;
font-size: 12pt;
}
#wrapper, #content {
width: auto;
height: auto;
margin: 0 5%;
padding: 0;
border: 0;
float: none !important;
color: #000;
background: transparent none;
}
#content {
margin: 10px;
}
#header, #menu, #sidebar, #footer, .noprint {
display: none;
}
#statement {
display: block;
border: 1px solid #666;
padding: 10px;
}
a:link, a:visited {
color: #781351;
background: transparent;
text-decoration: underline;
}
a:link:after, a:visited:after {
content: " [" attr(href) "] ";
}

References:

Similar Posts:

Posted by Michael Gaigg

Comments (90) Trackbacks (0)
  1. Following the scanning, the OCR software program converts the particular images in to intelligible character
    types and phrases. Then, the recognized textual content is voiced using a synthesizer.

  2. Wonderful goods from you, man. I have have in mind your stuff
    prior to and you are simply extremely fantastic.
    I really like what you have obtained right here, really like
    what you are stating and the best way by which you assert it.

    You’re making it enjoyable and you continue to care for to stay it sensible.

    I can’t wait to read far more from you. That is really a great site.

  3. It’s going to be finish of mine day, however before ending I am reading this
    enormous article to improve my know-how.

  4. This design is spectacular! You obviously know how to keep a reader amused.

    Between your wit and your videos, I was almost moved to start my own blog (well, almost…HaHa!) Great
    job. I really enjoyed what you had to say, and more than that, how you presented it.
    Too cool!

  5. I really like what you guys are usually up too. This sort of clever work and reporting!

    Keep up the wonderful works guys I’ve included you guys to blogroll.

  6. This will allow you to select the restore point we just produced prior
    to starting this whole procedure. Not all retailers online will take a return, and you should
    shy away from them. Start by downloading the latest version of iTunes.

  7. Good article! We are linking to this particularly great post on our website.
    Keep up the good writing.

  8. I do not even understand how I stopped up here,
    however I believed this publish was once good.

    I don’t recognize who you are however certainly you’re
    going to a famous blogger for those who aren’t already. Cheers!

  9. It’s going to be finish of mine day, but before finish I am reading this

    wonderful article to increase my know-how.

  10. Wow! At last I got a web site from where I know how to genuinely take
    valuable information concerning my study and knowledge.

  11. Hello! I’m at work browsing your blog from my new iphone 4!
    Just wanted to say I love reading your blog and
    look forward to all your posts! Carry on the
    superb work!

  12. Hey there! I’m at work browsing your blog from my new iphone 3gs!
    Just wanted to say I love reading your blog and look forward to all
    your posts! Keep up the superb work!

  13. Normally I do not learn article on blogs, but I would

    like to say that this write-up very forced me to try and

    do it! Your writing style has been amazed me. Thank you, quite nice article.

  14. I drop a leave a response whenever I especially enjoy a post

    on a website or if I have something to valuable to contribute to the conversation.

    Usually it is a result of the fire displayed in the post I browsed.

    And after this post Design Guidelines: Print Stylesheet | Michael Gaigg:

    Über UI/UX Design. I was moved enough to drop a thought :-P I do have 2 questions for you

    if it’s okay. Is it simply me or do a few of the responses look like they are written by brain dead people?
    :-P And, if you are writing on additional social sites, I

    would like to keep up with you. Would you make a list all of your social pages

    like your twitter feed, Facebook page or linkedin profile?

  15. I know this website gives quality based posts and extra material, is there any other site which presents these kinds of things in quality?

  16. Your Lifeless Induce 2 Hack v3 enables you to discover most
    guns for free, so what are you currently waiting for?

  17. Valuable info. Fortunate me I found your website by chance, and I’m stunned why this twist
    of fate did not happened earlier! I bookmarked it.

  18. Hi! Do you use Twitter? І’d likе tߋ follow youu if that woսld Ƅe okay.
    I’m undoubtedly enjoying yoսr blog and lߋоk forward to neա updates.

  19. Hey there, You have done a fantastic job. I’ll definitely digg it
    and personally suggest to my friends. I am sure they will be benefited from
    this website.

  20. It’s actually a nice and useful piece of info. I’m happy that
    you just shared this useful information with us. Please keep us informed
    like this. Thanks for sharing.

  21. After I initially left a comment I appear to have clicked on the -Notify me when new comments are added- checkbox and from now on every time a comment is added I recieve four emails
    with the same comment. Perhaps there is a means you are able to remove me from that
    service? Cheers!

  22. We stumbled over here different web page and thought I might as well check things out.

    I like what I see so now i am following you. Look forward to looking into your web page
    again.

  23. It’s actually a nice and useful piece of info. I’m happy that you
    simply shared this useful information with us.
    Please stay us up to date like this. Thank you for sharing.

  24. Very rapidly this web site will be famous amid all blog
    visitors, due to it’s good articles

  25. Wow that was unusual. I just wrote an really long comment but after I clicked submit my comment didn’t show up.
    Grrrr… well I’m not writing all that over again. Anyways, just
    wanted to say excellent blog!

  26. With havin so much written content do you ever run into
    any issues of plagorism or copyright violation? My website has
    a lot of exclusive content I’ve either created myself
    or outsourced but it looks like a lot of it is popping it up all over the internet without my authorization. Do you know any solutions to help
    prevent content from being ripped off? I’d genuinely appreciate it.

  27. For the reason that the admin of this website is working, no doubt very
    soon it will be famous, due to its quality contents.

  28. After looking into a handful of the blog posts on your web site, I seriously appreciate

    your technique of writing a blog. I book-marked it to my bookmark site

    list and will be checking back soon. Please visit my website

    as well and tell me what you think.

  29. It will only enhance it further and make it
    open to other networks. You will need to obtain each bootloaders (bl39.bin and bl46.bin) from the web.
    This is the location you will get the fantastic element of
    the technique.

  30. What is going to function as the features of Windows Telephone 8?
    Twitter and Facebook communicate with eachother, being an upgrade and this tweet
    will be on your own Facebook wall.

  31. As an instance, WhatsApp features a consumer base that exceeds
    two hundred million. So, why not attempt that luck, and who knows you might hit the jackpot.
    Just as there are advantages to cloud storage there are also disadvantages.

  32. The game has 10 levels to complete which include mobile games moviestarplanet hack is on the smartphones.
    The game itself and keep playing. While some games that
    followed the moviestarplanet hack genre. Now there is a hack
    and slash style RPG with monster waves, crafting materials and
    more enjoyment with mobile device earlier. The game should be available in such a casual manner.
    These games are also some websites from moviestarplanet hack
    where the game.

  33. While gaming in general whether, computer, and the amusing and fun, some phones will send the caller to
    voicemail. This game comes with 300 exciting true skate cheats channels.
    Any good company will have to juggle many things. The candy is tied using ropes.

    These two were followed by the red square. 0 or later, don’t drag the true skate
    cheats ball. Most automobile financing agreements allow
    a creditor to repossess your true skate cheats car.
    Industry analysts say that people would pay large sums of money for
    downloading any mobile manufacturing company.

  34. Hi just wanted to give you a brief heads up and let you
    know a few of the images aren’t loading correctly.

    I’m not sure why but I think its a linking issue. I’ve tried it in two different internet browsers and both show the same results.

  35. Ceea ce este de spus , trebuie să aibă – ca suporterii wonkish a avut în timpul anilor Bush – un focus –
    Lazer ca . Cu cumpărături individ , vei
    detecta magazine pentru a vedea . Ordinele doctorului este # 9 în apelurile de bingo .

  36. The key difference is more in the terminology.

  37. Birthday parties stardom hollywood cheats for children to play
    the games have really started fascinating players to play realistically.

  38. It is correct, having a regular company blog is valuable if done appropriately.
    This section features a large amount of helpful info.
    In addition they be determined by search engines to help.

  39. Or even, it’s probably less expensive to get a new ePrinter!
    The 10-hour battery shouldn’t be left-out either. 10 hours of
    movie? Inspire CRM provides iPad user tools for salespeople to control new business leads.


Leave a comment

No trackbacks yet.