SlideShare uma empresa Scribd logo
1 de 67
Making Your Site Printable
Presented by Adrian Roselli
July 15, 2014
#CSSSummit
About Adrian Roselli
• Co-written four books.
• Technical editor
for two books.
• Written over fifty
articles, most recently
for .net Magazine and
Web Standards Sherpa.
Great bedtime reading!
About Adrian Roselli
• Member of W3C HTML Working Group, W3C
Accessibility Task Force, five W3C Community
Groups.
• Building for the web since 1994.
• Founder, owner at Algonquin Studios
(AlgonquinStudios.com).
• Learn more at AdrianRoselli.com.
• Avoid on Twitter @aardrian.
I warned you.
What We’ll Cover
What We’ll Cover
• Background
• Techniques
• Measuring
• Future
• Questions
Background
Responsive Web Design (RWD)
• Responsive design (or
adaptive design) is about
supporting any device:
• Desktop computer
• Smartphone
• Tablet
• Television
• Printer?
Photo of printed page from http://elliotjaystocks.com/blog/has-adaptive-design-failed-of-course-it-bloody-hasnt/
PrintShame.com
• As developers tout their responsive designs,
they often forget the printed page.
• Support for print styles goes back more than a
decade, before RWD.
• Used MediaQueri.es as initial seed, then
picked up from articles, awards, etc.
• Hoped shaming might improve state of print
styles.
• http://PrintShame.com
PrintShame.com
http://www.printshame.com/2012/06/foundationzurbcom.html
PrintShame.com
Source page: http://foundation.zurb.com/docs/components/grid.html
Maturing (a bit)
• Decided the best approach would be teaching.
• Used lessons, common issues from
PrintShame to develop tutorial(s).
• Pitched this very talk.
Print Services
• Add a third-party “print” button to your site.
• You have no control over layout.
• You have no control over ads.
• You have no control.
Print Services
http://rosel.li/040612 “More Evidence of the Need for Print Styles”
Techniques
Screen versus Print
Screen
• Continuous
• Visual, audible, tactile
• Vector and bitmap
• Interactive
• Online
Print
• Paged
• Visual
• Bitmap
• Static
• Offline
Planning
• Is my site built mobile-first?
• Things I want the user to see.
• Things the user may not want to see.
• Things that probably won’t print anyway.
Planning
• Is my site built mobile-first?
• Sometimes your mobile-first styles will get you
nearly all the way there.
• If you built desktop-first, you may be able to re-
use your smaller viewport styles.
Planning
• Things I want the user to see:
• Branding
• Cross-branding
• Page address
• Copyright
• Path to page (breadcrumb)
• Link addresses (?)
Planning
• Things the user may not want to see:
• Primary navigation
• Secondary navigation
• Site search
• Social media icons
• Ad banners
• Fat footers
Planning
• Things that probably won’t print anyway:
• Colors
• Backgrounds (images and colors)
• Bits of timed / interactive elements
• White elements (logos, text, effects)
Examples: Caveats
• The following CSS examples are just examples.
• Selectors vary between IDs, classes and
elements to show something that may be
familiar to everyone
• Styles may differ from what is on the live site,
sometimes to remove redundancy or simplify
code samples.
Example
No Print Styles
Calling Print Styles
Make a home for your print styles:
@media print {
/* insert your style declarations here */
}
Or:
<link rel="stylesheet" type="text/css"
href="/css/print.css" media="print">
General Styles
• Reset type sizes to points, set text to black.
• Points (mostly) provide more consistent text size
across browsers and devices than pixels.
• Light grey text doesn’t trigger browser overrides
to convert text to black.
• Not all users have color printers. Set red to black
so it doesn’t come out as a medium gray (perhaps
with other styles as appropriate).
General Styles
• Clear whitespace around the content.
• User’s print settings will handle page margins.
• Lets user get as much content on a page as
possible (yay for trees!).
• You shouldn’t need to worry about portrait vs.
landscape, A4 vs. 8.5×11, etc.
General Styles
• Write values of title (or alt, or data-*, etc.)
attributes into the page.
• Think @cite on blockquote, or @title on abbr.
• You can do this with most attributes on most
elements, although it might not be a good fit.
• Perhaps a @data-shortURL attribute to display a
minified link address to make it easier for users to
type URLs.
• A novel way to promote @longdesc.
In-Page Links
Select links in content container(s) and then
display the href value as text after the link.
#Content a[href]:after {
content: " [" attr(href) "] ";
word-wrap: break-word;
}
#Content a[href^="#"]:after, #Content
a[href^="tel"]:after, #Content a[href^="mailto"]:after,
#Content a[href^="javascript"]:after {
content: "";
}
Yes, you can do the inverse selector, but then I don’t get to show the variations!
First Round of Changes
First Round of Changes
Navigation
• Get rid of the primary, secondary, tertiary
navigation,
• Remove social media links,
• Remove other bits that won’t make sense
when printed.
#Nav, #FlyOutNav, #SubNav, .NoPrint, #SMLinks {
display: none;
}
Navigation
Breadcrumb
Keep the breadcrumb as a wayfinding method, but
reduce its size and don’t expand the links.
#Bread a:link, #Bread a:visited {
text-decoration: underline;
color: #000;
}
#Bread {
color: #000;
font-size: 6pt;
}
#Bread > a:after {
content: "";
}
Banner
• Change any text to
print units,
• Adjust colors,
• Handle spacing,
• Make sure you keep
the logo.
• Consider SVG.
Footer
• Change any text to print units,
• Adjust colors,
• Handle spacing,
• Remove unneeded bits.
footer {
border-top: 1px solid #000;
font-size: 6pt;
color: #000;
background-color: transparent;
}
footer p {
margin: 0;
color: #000;
}
footer p a::after {
content: attr(data-alt);
}
footer img {
display: none;
}
Page Breaks
The CSS properties page-break-before, page-
break-after and page-break-inside have the
following values:
• auto: default value, no specified behavior.
• avoid: tries to avoid a page-break.
• always: invokes a page-break (not for page-break-
inside).
• left | right: Tries to place element on the start of a page
on the left or right, for when you are printing bound material
(books, magazines, etc.) (not for page-break-inside).
Further Consideration
• Hide videos.
• Hide controls for embedded audio.
• Hide Flash movies.
• Hide canvas elements (assuming interactive).
• Don’t scale images to 100% width (looking at
you, mobile styles and frameworks).
• Determine if ads should be printed or not.
Before (9 pages)
After (2 pages)
Widows and Orphans
Use these to control how many lines must be at
the end of a page (orphans) or how many at the
start of a page (widows).
p {
orphans: 3; /* 3 consecutive lines at end of page */
widows: 2; /* 2 lines at start of new page */
}
Because widows and orphans are confusing: http://en.wikipedia.org/wiki/Widows_and_orphans
Invert Logos
For those rare cases with a white logo where
you can’t load an alternate image (Chrome &
Safari only):
Img#Logo {
-webkit-filter: invert(100%);
filter: invert(100%);
}
If you can load an alternate, a quick tutorial:
http://www.456bereastreet.com/archive/201305/replacing_images_when_printing/
QR Codes
• They’re a personal (lifestyle) choice.
• Allows more savvy users to get directly to the
source of the printed page.
• Easy to implement without burdening mobile
users, users who do not print.
• Not perfect – they don’t always fire in time.
Call the QR Code
<html>
<head>
<style>
@media print {
header::before { content:
url(http://chart.apis.google.com/chart?chs=120x120&cht=qr&
chl=http%3A%2F%2Falgonquinstudios.com/Engage/Careers); }
}
</style>
</head>
QR Code in Use
Mobile
• Consider the explosion of mobile.
• Same goals on mobile as desktop.
• Mobile has played catch-up in print, but has
arrived within past year.
• Firefox & Safari print background colors.
• Firefox used odd page size.
• Android browser outputs raster PDF.
Printing from Mobile Has Improved: http://rosel.li/063014
Mobile
Android Browser Chrome Firefox
Mobile
Android Browser Chrome Firefox
TEST!
• Print to PDF for your first (most) rounds.
• Chrome Developer Tools (next slide).
• Use every browser you can.
• Use each browser visiting your site.
• Change paper size (8.5" × 11", A4, etc.).
• Change paper orientation.
• Scale the content in the print dialog.
Chrome Developer Tools
1. Open the drawer,
2. Select the Emulation tab,
3. Choose Screen,
4. At the bottom check CSS Media,
5. Choose print from the menu.
Chrome Developer Tools
Measuring
Google Analytics
• Call the GA tracking image, but only when the
print styles get used.
• Attach a custom event to that image.
• View custom events in Google Analytics.
• Identify which pages get printed.
• Make sure that at least those pages print well.
• For fun, compare to your carousel.
Full tutorial: http://rosel.li/032613
Query String Parameters
Variable Description
utmac Account String. Appears on all requests. This is your UA-#######-# ID.
utmwv
Tracking code version. While my standard GA requests use 5.4.0, I opted to use 4.3 for reasons I no
longer recall.
utmn
Unique ID generated for each GIF request to prevent caching of the GIF image. I just concatenate the
current year, month, day, hour, minute and second.
utmhn Host Name of your site, which is a URL-encoded string.
utmr Referral, complete URL. In this case I just insert a dash so it is not blank.
utmp Page request of the current page.
utmt
Indicates the type of request, which is one of: event, transaction, item, or a custom variable. If
you leave it blank, it defaults to page. Because I am tracking events, I use event.
utme Extensible parameter. This is where you write your event. I use 5(Print*{page address}).
utmcc
Cookie values. This request parameter sends all the cookies requested from the page. It can get
pretty long. It must be URL encoded. It must include __utma and __utmz values.
Sample Query String
http://www.google-analytics.com/__utm.gif
?utmac=UA-1464893-3
&utmwv=4.3
&utmn=2013326124551
&utmhn=algonquinstudios.com
&utmr=-
&utmp=/Engage/Careers
&utmt=event
&utme=5%28Print*/Engage/Careers%29
&utmcc=__utma%3D267504222.1477743002.1364314722.1364314722
.1364314722.1%3B%2B__utmb%3D267504222.17.7.1364314901604%3
B%2B__utmz%3D267504222.1364314722.1.1.utmcsr%3D%28direct%2
9|utmccn%3D%28direct%29|utmcmd%3D%28none%29
Call the Image
<html>
<head>
<style>
@media print {
header::after { content: url(http://www.google-
analytics.com/__utm.gif?utmac=UA-1464893-
3&utmwv=4.3&utmn=2013326124551&utmhn=algonquinstudios.com&
utmr=&utmp=/Engage/Careers&utmt=event&utme=5%28Print*/Enga
ge/Careers%29&utmcc=__utma%3D267504222.1477743002.13643147
22.1364314722.1364314722.1%3B%2B__utmb%3D267504222.17.7.13
64314901604%3B%2B__utmz%3D267504222.1364314722.1.1.utmcsr%
3D%28direct%29|utmccn%3D%28direct%29|utmcmd%3D%28none%29);
}
}
</style>
</head>
Check the Data
Check the Data
Future
Here or on Its Way
• Browser support for existing features.
• Electronic Books.
• HTML5 as a publishing platform.
• CSS3, CSS4.
Page Rules
The @page rule allows you to specify page
margins (CSS 2.1), size and orientation (CSS3).
@page {
margin: 20cm;
size: A4 landscape;
}
I recommend you do not use it and defer to user
preferences.
Left, Right, First Pages
• Use @page rule with pseudo classes to specify
right, left, first:
• :right will affect the page on the right.
• :left will affect the page on the left.
• :first will affect the first page.
• :blank will affect the blank pages resulting from forced break.
• An @page rule with no pseudo classes applies
to all pages.
Bleed and Crops
• The bleed property relies on the crops
property having a value.
• Bleed specifies how much the page can
extend outside the page box:
• <length> units, referring to width of page box.
• Crop draws marks outside page box:
• crop: shows where a page should be cut.
• cross: used to align sheets.
Boxes across Pages
• The box-decoration-break specifies how a
box’s background, margin and border behave
when broken across pages:
• slice: chops the box in two.
• clone: duplicates the styles
onto each box.
Page Margin Boxes
@page {
@bottom-left {
content: "Copyright me."
}
@bottom-right {
counter-increment: page;
content: "Page " counter(page);
}
}
Wrap-up, Questions
Further Reading
• Tracking Printed Pages (or How to Validate Assumptions)
webstandardssherpa.com/reviews/tracking-printed-pages/
• Make your website printable with CSS:
www.creativebloq.com/responsive-web-design/make-your-website-printable-css-3132929
• Calling QR in Print CSS Only When Needed:
rosel.li/030813
• Tracking When Users Print Pages:
rosel.li/032613
• Tips And Tricks For Print Style Sheets:
coding.smashingmagazine.com/2013/03/08/tips-tricks-print-style-sheets/
• Printing The Web:
drublic.de/blog/printing-the-web/
• CSS Paged Media Level 2:
www.w3.org/TR/CSS2/page.html
• CSS Paged Media Module Level 3:
www.w3.org/TR/css3-page/
• Proposals for the future of CSS Paged Media:
dev.w3.org/csswg/css-page-4/
• Can you typeset a book with CSS?
www.w3.org/Talks/2013/0604-CSS-Tokyo/
Making Your Site Printable
Presented by Adrian Roselli
July 15, 2014
#CSSSummit

Mais conteúdo relacionado

Mais procurados

Selfish Accessibility: WordCamp London 2017
Selfish Accessibility: WordCamp London 2017Selfish Accessibility: WordCamp London 2017
Selfish Accessibility: WordCamp London 2017Adrian Roselli
 
Selfish Accessibility: Government Digital Service
Selfish Accessibility: Government Digital ServiceSelfish Accessibility: Government Digital Service
Selfish Accessibility: Government Digital ServiceAdrian Roselli
 
Prototyping Accessibility - WordCamp Europe 2018
Prototyping Accessibility - WordCamp Europe 2018Prototyping Accessibility - WordCamp Europe 2018
Prototyping Accessibility - WordCamp Europe 2018Adrian Roselli
 
Abstractions: Fringe Accessibility
Abstractions: Fringe AccessibilityAbstractions: Fringe Accessibility
Abstractions: Fringe AccessibilityAdrian Roselli
 
Selfish Accessibility for Global Accessibility Awareness Day
Selfish Accessibility for Global Accessibility Awareness DaySelfish Accessibility for Global Accessibility Awareness Day
Selfish Accessibility for Global Accessibility Awareness DayAdrian Roselli
 
Selfish accessibility: 2015 Buffalo Unconference
Selfish accessibility: 2015 Buffalo UnconferenceSelfish accessibility: 2015 Buffalo Unconference
Selfish accessibility: 2015 Buffalo UnconferenceAdrian Roselli
 
Guelph A11y Conf: Everything I Know About Accessibility I Learned from Stack ...
Guelph A11y Conf: Everything I Know About Accessibility I Learned from Stack ...Guelph A11y Conf: Everything I Know About Accessibility I Learned from Stack ...
Guelph A11y Conf: Everything I Know About Accessibility I Learned from Stack ...Adrian Roselli
 
Selfish Accessibility — CodeDaze
Selfish Accessibility — CodeDazeSelfish Accessibility — CodeDaze
Selfish Accessibility — CodeDazeAdrian Roselli
 
Selfish Accessibility — Harbour Front HK
Selfish Accessibility — Harbour Front HKSelfish Accessibility — Harbour Front HK
Selfish Accessibility — Harbour Front HKAdrian Roselli
 
Selfish Accessibility: a11y Camp NYC 2015
Selfish Accessibility: a11y Camp NYC 2015Selfish Accessibility: a11y Camp NYC 2015
Selfish Accessibility: a11y Camp NYC 2015Adrian Roselli
 
Fringe Accessibility: Booster 2016
Fringe Accessibility: Booster 2016Fringe Accessibility: Booster 2016
Fringe Accessibility: Booster 2016Adrian Roselli
 
Selfish Accessibility: Presented at Google
Selfish Accessibility: Presented at GoogleSelfish Accessibility: Presented at Google
Selfish Accessibility: Presented at GoogleAdrian Roselli
 
Accessible Design WordCamp Europe 2018 in Belgrad
Accessible Design WordCamp Europe 2018 in BelgradAccessible Design WordCamp Europe 2018 in Belgrad
Accessible Design WordCamp Europe 2018 in BelgradMaja Benke
 
Mind your lang (for role=drinks at CSUN 2017)
Mind your lang (for role=drinks at CSUN 2017)Mind your lang (for role=drinks at CSUN 2017)
Mind your lang (for role=drinks at CSUN 2017)Adrian Roselli
 
WordPress Accessibility - WordCamp Buffalo 2016
WordPress Accessibility - WordCamp Buffalo 2016WordPress Accessibility - WordCamp Buffalo 2016
WordPress Accessibility - WordCamp Buffalo 2016Adrian Roselli
 
Selfish Accessibility: UXSG 2014
Selfish Accessibility: UXSG 2014Selfish Accessibility: UXSG 2014
Selfish Accessibility: UXSG 2014Adrian Roselli
 
Web Accessibility for the 21st Century
Web Accessibility for the 21st CenturyWeb Accessibility for the 21st Century
Web Accessibility for the 21st Centurydreamwidth
 
Tales from the Accessibility Trenches
Tales from the Accessibility TrenchesTales from the Accessibility Trenches
Tales from the Accessibility Trenchesgraemecoleman
 
Prototyping Accessibility: Booster 2019
Prototyping Accessibility: Booster 2019Prototyping Accessibility: Booster 2019
Prototyping Accessibility: Booster 2019Adrian Roselli
 
Fringe Accessibility: A11y Camp Toronto 2015
Fringe Accessibility: A11y Camp Toronto 2015Fringe Accessibility: A11y Camp Toronto 2015
Fringe Accessibility: A11y Camp Toronto 2015Adrian Roselli
 

Mais procurados (20)

Selfish Accessibility: WordCamp London 2017
Selfish Accessibility: WordCamp London 2017Selfish Accessibility: WordCamp London 2017
Selfish Accessibility: WordCamp London 2017
 
Selfish Accessibility: Government Digital Service
Selfish Accessibility: Government Digital ServiceSelfish Accessibility: Government Digital Service
Selfish Accessibility: Government Digital Service
 
Prototyping Accessibility - WordCamp Europe 2018
Prototyping Accessibility - WordCamp Europe 2018Prototyping Accessibility - WordCamp Europe 2018
Prototyping Accessibility - WordCamp Europe 2018
 
Abstractions: Fringe Accessibility
Abstractions: Fringe AccessibilityAbstractions: Fringe Accessibility
Abstractions: Fringe Accessibility
 
Selfish Accessibility for Global Accessibility Awareness Day
Selfish Accessibility for Global Accessibility Awareness DaySelfish Accessibility for Global Accessibility Awareness Day
Selfish Accessibility for Global Accessibility Awareness Day
 
Selfish accessibility: 2015 Buffalo Unconference
Selfish accessibility: 2015 Buffalo UnconferenceSelfish accessibility: 2015 Buffalo Unconference
Selfish accessibility: 2015 Buffalo Unconference
 
Guelph A11y Conf: Everything I Know About Accessibility I Learned from Stack ...
Guelph A11y Conf: Everything I Know About Accessibility I Learned from Stack ...Guelph A11y Conf: Everything I Know About Accessibility I Learned from Stack ...
Guelph A11y Conf: Everything I Know About Accessibility I Learned from Stack ...
 
Selfish Accessibility — CodeDaze
Selfish Accessibility — CodeDazeSelfish Accessibility — CodeDaze
Selfish Accessibility — CodeDaze
 
Selfish Accessibility — Harbour Front HK
Selfish Accessibility — Harbour Front HKSelfish Accessibility — Harbour Front HK
Selfish Accessibility — Harbour Front HK
 
Selfish Accessibility: a11y Camp NYC 2015
Selfish Accessibility: a11y Camp NYC 2015Selfish Accessibility: a11y Camp NYC 2015
Selfish Accessibility: a11y Camp NYC 2015
 
Fringe Accessibility: Booster 2016
Fringe Accessibility: Booster 2016Fringe Accessibility: Booster 2016
Fringe Accessibility: Booster 2016
 
Selfish Accessibility: Presented at Google
Selfish Accessibility: Presented at GoogleSelfish Accessibility: Presented at Google
Selfish Accessibility: Presented at Google
 
Accessible Design WordCamp Europe 2018 in Belgrad
Accessible Design WordCamp Europe 2018 in BelgradAccessible Design WordCamp Europe 2018 in Belgrad
Accessible Design WordCamp Europe 2018 in Belgrad
 
Mind your lang (for role=drinks at CSUN 2017)
Mind your lang (for role=drinks at CSUN 2017)Mind your lang (for role=drinks at CSUN 2017)
Mind your lang (for role=drinks at CSUN 2017)
 
WordPress Accessibility - WordCamp Buffalo 2016
WordPress Accessibility - WordCamp Buffalo 2016WordPress Accessibility - WordCamp Buffalo 2016
WordPress Accessibility - WordCamp Buffalo 2016
 
Selfish Accessibility: UXSG 2014
Selfish Accessibility: UXSG 2014Selfish Accessibility: UXSG 2014
Selfish Accessibility: UXSG 2014
 
Web Accessibility for the 21st Century
Web Accessibility for the 21st CenturyWeb Accessibility for the 21st Century
Web Accessibility for the 21st Century
 
Tales from the Accessibility Trenches
Tales from the Accessibility TrenchesTales from the Accessibility Trenches
Tales from the Accessibility Trenches
 
Prototyping Accessibility: Booster 2019
Prototyping Accessibility: Booster 2019Prototyping Accessibility: Booster 2019
Prototyping Accessibility: Booster 2019
 
Fringe Accessibility: A11y Camp Toronto 2015
Fringe Accessibility: A11y Camp Toronto 2015Fringe Accessibility: A11y Camp Toronto 2015
Fringe Accessibility: A11y Camp Toronto 2015
 

Semelhante a Making Your Site Printable: Essential Techniques for Optimizing Web Pages for Print

Making Your Site Printable: Booster Conference
Making Your Site Printable: Booster ConferenceMaking Your Site Printable: Booster Conference
Making Your Site Printable: Booster ConferenceAdrian Roselli
 
The web standards gentleman: a matter of (evolving) standards)
The web standards gentleman: a matter of (evolving) standards)The web standards gentleman: a matter of (evolving) standards)
The web standards gentleman: a matter of (evolving) standards)Chris Mills
 
Fringe Accessibility — Portland UX
Fringe Accessibility — Portland UXFringe Accessibility — Portland UX
Fringe Accessibility — Portland UXAdrian Roselli
 
Week 8 - Interactive News Editing and Producing
Week 8 - Interactive News Editing and ProducingWeek 8 - Interactive News Editing and Producing
Week 8 - Interactive News Editing and Producingkurtgessler
 
FITC - 2012-04-23 - Responsive Web Design
FITC - 2012-04-23 - Responsive Web DesignFITC - 2012-04-23 - Responsive Web Design
FITC - 2012-04-23 - Responsive Web DesignFrédéric Harper
 
"Responsive Web Design: Clever Tips and Techniques". Vitaly Friedman, Smashin...
"Responsive Web Design: Clever Tips and Techniques". Vitaly Friedman, Smashin..."Responsive Web Design: Clever Tips and Techniques". Vitaly Friedman, Smashin...
"Responsive Web Design: Clever Tips and Techniques". Vitaly Friedman, Smashin...Yandex
 
Making your site printable: WordCamp Buffalo 2013
Making your site printable: WordCamp Buffalo 2013Making your site printable: WordCamp Buffalo 2013
Making your site printable: WordCamp Buffalo 2013Adrian Roselli
 
Great Responsive-ability Web Design
Great Responsive-ability Web DesignGreat Responsive-ability Web Design
Great Responsive-ability Web DesignMike Wilcox
 
Node.js 101
 Node.js 101 Node.js 101
Node.js 101FITC
 
FITC - Bootstrap Unleashed
FITC - Bootstrap UnleashedFITC - Bootstrap Unleashed
FITC - Bootstrap UnleashedRami Sayar
 
Atlanta Drupal User Group (ADUG)
Atlanta Drupal User Group (ADUG) Atlanta Drupal User Group (ADUG)
Atlanta Drupal User Group (ADUG) Mediacurrent
 
Fundamentals of Web
Fundamentals of WebFundamentals of Web
Fundamentals of WebSabir Haque
 
Responsive Design Overview for UB CIT
Responsive Design Overview for UB CITResponsive Design Overview for UB CIT
Responsive Design Overview for UB CITAdrian Roselli
 
Mobile Best Practices
Mobile Best PracticesMobile Best Practices
Mobile Best Practicesmintersam
 
Responsive Web Design_2013
Responsive Web Design_2013Responsive Web Design_2013
Responsive Web Design_2013Achieve Internet
 
Web Service Creation in HTML5
Web Service Creation in HTML5Web Service Creation in HTML5
Web Service Creation in HTML5Tero A. Laiho
 
Role of Design in Accessibility — VilniusJS Meet-up
Role of Design in Accessibility — VilniusJS Meet-upRole of Design in Accessibility — VilniusJS Meet-up
Role of Design in Accessibility — VilniusJS Meet-upAdrian Roselli
 
SEF 2014 - Responsive Design in SharePoint 2013
SEF 2014 - Responsive Design in SharePoint 2013SEF 2014 - Responsive Design in SharePoint 2013
SEF 2014 - Responsive Design in SharePoint 2013Marc D Anderson
 
Responsive Web Design tips and tricks.
Responsive Web Design tips and tricks.Responsive Web Design tips and tricks.
Responsive Web Design tips and tricks.GaziAhsan
 

Semelhante a Making Your Site Printable: Essential Techniques for Optimizing Web Pages for Print (20)

Making Your Site Printable: Booster Conference
Making Your Site Printable: Booster ConferenceMaking Your Site Printable: Booster Conference
Making Your Site Printable: Booster Conference
 
The web standards gentleman: a matter of (evolving) standards)
The web standards gentleman: a matter of (evolving) standards)The web standards gentleman: a matter of (evolving) standards)
The web standards gentleman: a matter of (evolving) standards)
 
Fringe Accessibility — Portland UX
Fringe Accessibility — Portland UXFringe Accessibility — Portland UX
Fringe Accessibility — Portland UX
 
Week 8 - Interactive News Editing and Producing
Week 8 - Interactive News Editing and ProducingWeek 8 - Interactive News Editing and Producing
Week 8 - Interactive News Editing and Producing
 
FITC - 2012-04-23 - Responsive Web Design
FITC - 2012-04-23 - Responsive Web DesignFITC - 2012-04-23 - Responsive Web Design
FITC - 2012-04-23 - Responsive Web Design
 
"Responsive Web Design: Clever Tips and Techniques". Vitaly Friedman, Smashin...
"Responsive Web Design: Clever Tips and Techniques". Vitaly Friedman, Smashin..."Responsive Web Design: Clever Tips and Techniques". Vitaly Friedman, Smashin...
"Responsive Web Design: Clever Tips and Techniques". Vitaly Friedman, Smashin...
 
Making your site printable: WordCamp Buffalo 2013
Making your site printable: WordCamp Buffalo 2013Making your site printable: WordCamp Buffalo 2013
Making your site printable: WordCamp Buffalo 2013
 
Great Responsive-ability Web Design
Great Responsive-ability Web DesignGreat Responsive-ability Web Design
Great Responsive-ability Web Design
 
Node.js 101
 Node.js 101 Node.js 101
Node.js 101
 
FITC - Bootstrap Unleashed
FITC - Bootstrap UnleashedFITC - Bootstrap Unleashed
FITC - Bootstrap Unleashed
 
Atlanta Drupal User Group (ADUG)
Atlanta Drupal User Group (ADUG) Atlanta Drupal User Group (ADUG)
Atlanta Drupal User Group (ADUG)
 
Fundamentals of Web
Fundamentals of WebFundamentals of Web
Fundamentals of Web
 
Responsive Design Overview for UB CIT
Responsive Design Overview for UB CITResponsive Design Overview for UB CIT
Responsive Design Overview for UB CIT
 
Mobile Best Practices
Mobile Best PracticesMobile Best Practices
Mobile Best Practices
 
Responsive Web Design_2013
Responsive Web Design_2013Responsive Web Design_2013
Responsive Web Design_2013
 
Web Service Creation in HTML5
Web Service Creation in HTML5Web Service Creation in HTML5
Web Service Creation in HTML5
 
Role of Design in Accessibility — VilniusJS Meet-up
Role of Design in Accessibility — VilniusJS Meet-upRole of Design in Accessibility — VilniusJS Meet-up
Role of Design in Accessibility — VilniusJS Meet-up
 
SEF 2014 - Responsive Design in SharePoint 2013
SEF 2014 - Responsive Design in SharePoint 2013SEF 2014 - Responsive Design in SharePoint 2013
SEF 2014 - Responsive Design in SharePoint 2013
 
Responsive Web Design tips and tricks.
Responsive Web Design tips and tricks.Responsive Web Design tips and tricks.
Responsive Web Design tips and tricks.
 
Rwd slidedeck
Rwd slidedeckRwd slidedeck
Rwd slidedeck
 

Mais de Adrian Roselli

CSUN 2020: CSS Display Properties Versus HTML Semantics
CSUN 2020: CSS Display Properties Versus HTML SemanticsCSUN 2020: CSS Display Properties Versus HTML Semantics
CSUN 2020: CSS Display Properties Versus HTML SemanticsAdrian Roselli
 
Selfish Accessibility —DevOpsDays Buffalo
Selfish Accessibility —DevOpsDays BuffaloSelfish Accessibility —DevOpsDays Buffalo
Selfish Accessibility —DevOpsDays BuffaloAdrian Roselli
 
Selfish Accessibility — YGLF Vilnius
Selfish Accessibility — YGLF VilniusSelfish Accessibility — YGLF Vilnius
Selfish Accessibility — YGLF VilniusAdrian Roselli
 
The Role of Design in Accessibility — a11yTO Meet-up
The Role of Design in Accessibility — a11yTO Meet-upThe Role of Design in Accessibility — a11yTO Meet-up
The Role of Design in Accessibility — a11yTO Meet-upAdrian Roselli
 
WCBuf: CSS Display Properties versus HTML Semantics
WCBuf: CSS Display Properties versus HTML SemanticsWCBuf: CSS Display Properties versus HTML Semantics
WCBuf: CSS Display Properties versus HTML SemanticsAdrian Roselli
 
Mind Your Lang — London Web Standards
Mind Your Lang — London Web StandardsMind Your Lang — London Web Standards
Mind Your Lang — London Web StandardsAdrian Roselli
 
Inclusive Usability Testing - WordCamp London
Inclusive Usability Testing - WordCamp LondonInclusive Usability Testing - WordCamp London
Inclusive Usability Testing - WordCamp LondonAdrian Roselli
 
CSUN 2018: Everything I Know About Accessibility I Learned from Stack Overflow
CSUN 2018: Everything I Know About Accessibility I Learned from Stack OverflowCSUN 2018: Everything I Know About Accessibility I Learned from Stack Overflow
CSUN 2018: Everything I Know About Accessibility I Learned from Stack OverflowAdrian Roselli
 
Inclusive Usability Testing — a11yTOCamp
Inclusive Usability Testing — a11yTOCampInclusive Usability Testing — a11yTOCamp
Inclusive Usability Testing — a11yTOCampAdrian Roselli
 
Selfish Accessibility - Girl Develop It Buffalo
Selfish Accessibility - Girl Develop It BuffaloSelfish Accessibility - Girl Develop It Buffalo
Selfish Accessibility - Girl Develop It BuffaloAdrian Roselli
 
Everything I Know About Accessibility I Learned from Stack Overflow
Everything I Know About Accessibility I Learned from Stack OverflowEverything I Know About Accessibility I Learned from Stack Overflow
Everything I Know About Accessibility I Learned from Stack OverflowAdrian Roselli
 
Inclusive User Testing — Guelph Accessibility Conference
Inclusive User Testing — Guelph Accessibility ConferenceInclusive User Testing — Guelph Accessibility Conference
Inclusive User Testing — Guelph Accessibility ConferenceAdrian Roselli
 
Implementing Accessibility: Accessibility Toronto
Implementing Accessibility: Accessibility TorontoImplementing Accessibility: Accessibility Toronto
Implementing Accessibility: Accessibility TorontoAdrian Roselli
 
Mind Your lang — Accessibility Camp Toronto 2016
Mind Your lang — Accessibility Camp Toronto 2016Mind Your lang — Accessibility Camp Toronto 2016
Mind Your lang — Accessibility Camp Toronto 2016Adrian Roselli
 
Role = Drinks 2016: Selfish Accessibility
Role = Drinks 2016: Selfish AccessibilityRole = Drinks 2016: Selfish Accessibility
Role = Drinks 2016: Selfish AccessibilityAdrian Roselli
 

Mais de Adrian Roselli (15)

CSUN 2020: CSS Display Properties Versus HTML Semantics
CSUN 2020: CSS Display Properties Versus HTML SemanticsCSUN 2020: CSS Display Properties Versus HTML Semantics
CSUN 2020: CSS Display Properties Versus HTML Semantics
 
Selfish Accessibility —DevOpsDays Buffalo
Selfish Accessibility —DevOpsDays BuffaloSelfish Accessibility —DevOpsDays Buffalo
Selfish Accessibility —DevOpsDays Buffalo
 
Selfish Accessibility — YGLF Vilnius
Selfish Accessibility — YGLF VilniusSelfish Accessibility — YGLF Vilnius
Selfish Accessibility — YGLF Vilnius
 
The Role of Design in Accessibility — a11yTO Meet-up
The Role of Design in Accessibility — a11yTO Meet-upThe Role of Design in Accessibility — a11yTO Meet-up
The Role of Design in Accessibility — a11yTO Meet-up
 
WCBuf: CSS Display Properties versus HTML Semantics
WCBuf: CSS Display Properties versus HTML SemanticsWCBuf: CSS Display Properties versus HTML Semantics
WCBuf: CSS Display Properties versus HTML Semantics
 
Mind Your Lang — London Web Standards
Mind Your Lang — London Web StandardsMind Your Lang — London Web Standards
Mind Your Lang — London Web Standards
 
Inclusive Usability Testing - WordCamp London
Inclusive Usability Testing - WordCamp LondonInclusive Usability Testing - WordCamp London
Inclusive Usability Testing - WordCamp London
 
CSUN 2018: Everything I Know About Accessibility I Learned from Stack Overflow
CSUN 2018: Everything I Know About Accessibility I Learned from Stack OverflowCSUN 2018: Everything I Know About Accessibility I Learned from Stack Overflow
CSUN 2018: Everything I Know About Accessibility I Learned from Stack Overflow
 
Inclusive Usability Testing — a11yTOCamp
Inclusive Usability Testing — a11yTOCampInclusive Usability Testing — a11yTOCamp
Inclusive Usability Testing — a11yTOCamp
 
Selfish Accessibility - Girl Develop It Buffalo
Selfish Accessibility - Girl Develop It BuffaloSelfish Accessibility - Girl Develop It Buffalo
Selfish Accessibility - Girl Develop It Buffalo
 
Everything I Know About Accessibility I Learned from Stack Overflow
Everything I Know About Accessibility I Learned from Stack OverflowEverything I Know About Accessibility I Learned from Stack Overflow
Everything I Know About Accessibility I Learned from Stack Overflow
 
Inclusive User Testing — Guelph Accessibility Conference
Inclusive User Testing — Guelph Accessibility ConferenceInclusive User Testing — Guelph Accessibility Conference
Inclusive User Testing — Guelph Accessibility Conference
 
Implementing Accessibility: Accessibility Toronto
Implementing Accessibility: Accessibility TorontoImplementing Accessibility: Accessibility Toronto
Implementing Accessibility: Accessibility Toronto
 
Mind Your lang — Accessibility Camp Toronto 2016
Mind Your lang — Accessibility Camp Toronto 2016Mind Your lang — Accessibility Camp Toronto 2016
Mind Your lang — Accessibility Camp Toronto 2016
 
Role = Drinks 2016: Selfish Accessibility
Role = Drinks 2016: Selfish AccessibilityRole = Drinks 2016: Selfish Accessibility
Role = Drinks 2016: Selfish Accessibility
 

Último

How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 

Último (20)

How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 

Making Your Site Printable: Essential Techniques for Optimizing Web Pages for Print

  • 1. Making Your Site Printable Presented by Adrian Roselli July 15, 2014 #CSSSummit
  • 2. About Adrian Roselli • Co-written four books. • Technical editor for two books. • Written over fifty articles, most recently for .net Magazine and Web Standards Sherpa. Great bedtime reading!
  • 3. About Adrian Roselli • Member of W3C HTML Working Group, W3C Accessibility Task Force, five W3C Community Groups. • Building for the web since 1994. • Founder, owner at Algonquin Studios (AlgonquinStudios.com). • Learn more at AdrianRoselli.com. • Avoid on Twitter @aardrian. I warned you.
  • 5. What We’ll Cover • Background • Techniques • Measuring • Future • Questions
  • 7. Responsive Web Design (RWD) • Responsive design (or adaptive design) is about supporting any device: • Desktop computer • Smartphone • Tablet • Television • Printer? Photo of printed page from http://elliotjaystocks.com/blog/has-adaptive-design-failed-of-course-it-bloody-hasnt/
  • 8. PrintShame.com • As developers tout their responsive designs, they often forget the printed page. • Support for print styles goes back more than a decade, before RWD. • Used MediaQueri.es as initial seed, then picked up from articles, awards, etc. • Hoped shaming might improve state of print styles. • http://PrintShame.com
  • 11. Maturing (a bit) • Decided the best approach would be teaching. • Used lessons, common issues from PrintShame to develop tutorial(s). • Pitched this very talk.
  • 12. Print Services • Add a third-party “print” button to your site. • You have no control over layout. • You have no control over ads. • You have no control.
  • 13. Print Services http://rosel.li/040612 “More Evidence of the Need for Print Styles”
  • 15. Screen versus Print Screen • Continuous • Visual, audible, tactile • Vector and bitmap • Interactive • Online Print • Paged • Visual • Bitmap • Static • Offline
  • 16. Planning • Is my site built mobile-first? • Things I want the user to see. • Things the user may not want to see. • Things that probably won’t print anyway.
  • 17. Planning • Is my site built mobile-first? • Sometimes your mobile-first styles will get you nearly all the way there. • If you built desktop-first, you may be able to re- use your smaller viewport styles.
  • 18. Planning • Things I want the user to see: • Branding • Cross-branding • Page address • Copyright • Path to page (breadcrumb) • Link addresses (?)
  • 19. Planning • Things the user may not want to see: • Primary navigation • Secondary navigation • Site search • Social media icons • Ad banners • Fat footers
  • 20. Planning • Things that probably won’t print anyway: • Colors • Backgrounds (images and colors) • Bits of timed / interactive elements • White elements (logos, text, effects)
  • 21. Examples: Caveats • The following CSS examples are just examples. • Selectors vary between IDs, classes and elements to show something that may be familiar to everyone • Styles may differ from what is on the live site, sometimes to remove redundancy or simplify code samples.
  • 24. Calling Print Styles Make a home for your print styles: @media print { /* insert your style declarations here */ } Or: <link rel="stylesheet" type="text/css" href="/css/print.css" media="print">
  • 25. General Styles • Reset type sizes to points, set text to black. • Points (mostly) provide more consistent text size across browsers and devices than pixels. • Light grey text doesn’t trigger browser overrides to convert text to black. • Not all users have color printers. Set red to black so it doesn’t come out as a medium gray (perhaps with other styles as appropriate).
  • 26. General Styles • Clear whitespace around the content. • User’s print settings will handle page margins. • Lets user get as much content on a page as possible (yay for trees!). • You shouldn’t need to worry about portrait vs. landscape, A4 vs. 8.5×11, etc.
  • 27. General Styles • Write values of title (or alt, or data-*, etc.) attributes into the page. • Think @cite on blockquote, or @title on abbr. • You can do this with most attributes on most elements, although it might not be a good fit. • Perhaps a @data-shortURL attribute to display a minified link address to make it easier for users to type URLs. • A novel way to promote @longdesc.
  • 28. In-Page Links Select links in content container(s) and then display the href value as text after the link. #Content a[href]:after { content: " [" attr(href) "] "; word-wrap: break-word; } #Content a[href^="#"]:after, #Content a[href^="tel"]:after, #Content a[href^="mailto"]:after, #Content a[href^="javascript"]:after { content: ""; } Yes, you can do the inverse selector, but then I don’t get to show the variations!
  • 29. First Round of Changes
  • 30. First Round of Changes
  • 31. Navigation • Get rid of the primary, secondary, tertiary navigation, • Remove social media links, • Remove other bits that won’t make sense when printed. #Nav, #FlyOutNav, #SubNav, .NoPrint, #SMLinks { display: none; }
  • 33. Breadcrumb Keep the breadcrumb as a wayfinding method, but reduce its size and don’t expand the links. #Bread a:link, #Bread a:visited { text-decoration: underline; color: #000; } #Bread { color: #000; font-size: 6pt; } #Bread > a:after { content: ""; }
  • 34. Banner • Change any text to print units, • Adjust colors, • Handle spacing, • Make sure you keep the logo. • Consider SVG.
  • 35. Footer • Change any text to print units, • Adjust colors, • Handle spacing, • Remove unneeded bits. footer { border-top: 1px solid #000; font-size: 6pt; color: #000; background-color: transparent; } footer p { margin: 0; color: #000; } footer p a::after { content: attr(data-alt); } footer img { display: none; }
  • 36. Page Breaks The CSS properties page-break-before, page- break-after and page-break-inside have the following values: • auto: default value, no specified behavior. • avoid: tries to avoid a page-break. • always: invokes a page-break (not for page-break- inside). • left | right: Tries to place element on the start of a page on the left or right, for when you are printing bound material (books, magazines, etc.) (not for page-break-inside).
  • 37. Further Consideration • Hide videos. • Hide controls for embedded audio. • Hide Flash movies. • Hide canvas elements (assuming interactive). • Don’t scale images to 100% width (looking at you, mobile styles and frameworks). • Determine if ads should be printed or not.
  • 40. Widows and Orphans Use these to control how many lines must be at the end of a page (orphans) or how many at the start of a page (widows). p { orphans: 3; /* 3 consecutive lines at end of page */ widows: 2; /* 2 lines at start of new page */ } Because widows and orphans are confusing: http://en.wikipedia.org/wiki/Widows_and_orphans
  • 41. Invert Logos For those rare cases with a white logo where you can’t load an alternate image (Chrome & Safari only): Img#Logo { -webkit-filter: invert(100%); filter: invert(100%); } If you can load an alternate, a quick tutorial: http://www.456bereastreet.com/archive/201305/replacing_images_when_printing/
  • 42. QR Codes • They’re a personal (lifestyle) choice. • Allows more savvy users to get directly to the source of the printed page. • Easy to implement without burdening mobile users, users who do not print. • Not perfect – they don’t always fire in time.
  • 43. Call the QR Code <html> <head> <style> @media print { header::before { content: url(http://chart.apis.google.com/chart?chs=120x120&cht=qr& chl=http%3A%2F%2Falgonquinstudios.com/Engage/Careers); } } </style> </head>
  • 44. QR Code in Use
  • 45. Mobile • Consider the explosion of mobile. • Same goals on mobile as desktop. • Mobile has played catch-up in print, but has arrived within past year. • Firefox & Safari print background colors. • Firefox used odd page size. • Android browser outputs raster PDF. Printing from Mobile Has Improved: http://rosel.li/063014
  • 48. TEST! • Print to PDF for your first (most) rounds. • Chrome Developer Tools (next slide). • Use every browser you can. • Use each browser visiting your site. • Change paper size (8.5" × 11", A4, etc.). • Change paper orientation. • Scale the content in the print dialog.
  • 49. Chrome Developer Tools 1. Open the drawer, 2. Select the Emulation tab, 3. Choose Screen, 4. At the bottom check CSS Media, 5. Choose print from the menu.
  • 52. Google Analytics • Call the GA tracking image, but only when the print styles get used. • Attach a custom event to that image. • View custom events in Google Analytics. • Identify which pages get printed. • Make sure that at least those pages print well. • For fun, compare to your carousel. Full tutorial: http://rosel.li/032613
  • 53. Query String Parameters Variable Description utmac Account String. Appears on all requests. This is your UA-#######-# ID. utmwv Tracking code version. While my standard GA requests use 5.4.0, I opted to use 4.3 for reasons I no longer recall. utmn Unique ID generated for each GIF request to prevent caching of the GIF image. I just concatenate the current year, month, day, hour, minute and second. utmhn Host Name of your site, which is a URL-encoded string. utmr Referral, complete URL. In this case I just insert a dash so it is not blank. utmp Page request of the current page. utmt Indicates the type of request, which is one of: event, transaction, item, or a custom variable. If you leave it blank, it defaults to page. Because I am tracking events, I use event. utme Extensible parameter. This is where you write your event. I use 5(Print*{page address}). utmcc Cookie values. This request parameter sends all the cookies requested from the page. It can get pretty long. It must be URL encoded. It must include __utma and __utmz values.
  • 55. Call the Image <html> <head> <style> @media print { header::after { content: url(http://www.google- analytics.com/__utm.gif?utmac=UA-1464893- 3&utmwv=4.3&utmn=2013326124551&utmhn=algonquinstudios.com& utmr=&utmp=/Engage/Careers&utmt=event&utme=5%28Print*/Enga ge/Careers%29&utmcc=__utma%3D267504222.1477743002.13643147 22.1364314722.1364314722.1%3B%2B__utmb%3D267504222.17.7.13 64314901604%3B%2B__utmz%3D267504222.1364314722.1.1.utmcsr% 3D%28direct%29|utmccn%3D%28direct%29|utmcmd%3D%28none%29); } } </style> </head>
  • 59. Here or on Its Way • Browser support for existing features. • Electronic Books. • HTML5 as a publishing platform. • CSS3, CSS4.
  • 60. Page Rules The @page rule allows you to specify page margins (CSS 2.1), size and orientation (CSS3). @page { margin: 20cm; size: A4 landscape; } I recommend you do not use it and defer to user preferences.
  • 61. Left, Right, First Pages • Use @page rule with pseudo classes to specify right, left, first: • :right will affect the page on the right. • :left will affect the page on the left. • :first will affect the first page. • :blank will affect the blank pages resulting from forced break. • An @page rule with no pseudo classes applies to all pages.
  • 62. Bleed and Crops • The bleed property relies on the crops property having a value. • Bleed specifies how much the page can extend outside the page box: • <length> units, referring to width of page box. • Crop draws marks outside page box: • crop: shows where a page should be cut. • cross: used to align sheets.
  • 63. Boxes across Pages • The box-decoration-break specifies how a box’s background, margin and border behave when broken across pages: • slice: chops the box in two. • clone: duplicates the styles onto each box.
  • 64. Page Margin Boxes @page { @bottom-left { content: "Copyright me." } @bottom-right { counter-increment: page; content: "Page " counter(page); } }
  • 66. Further Reading • Tracking Printed Pages (or How to Validate Assumptions) webstandardssherpa.com/reviews/tracking-printed-pages/ • Make your website printable with CSS: www.creativebloq.com/responsive-web-design/make-your-website-printable-css-3132929 • Calling QR in Print CSS Only When Needed: rosel.li/030813 • Tracking When Users Print Pages: rosel.li/032613 • Tips And Tricks For Print Style Sheets: coding.smashingmagazine.com/2013/03/08/tips-tricks-print-style-sheets/ • Printing The Web: drublic.de/blog/printing-the-web/ • CSS Paged Media Level 2: www.w3.org/TR/CSS2/page.html • CSS Paged Media Module Level 3: www.w3.org/TR/css3-page/ • Proposals for the future of CSS Paged Media: dev.w3.org/csswg/css-page-4/ • Can you typeset a book with CSS? www.w3.org/Talks/2013/0604-CSS-Tokyo/
  • 67. Making Your Site Printable Presented by Adrian Roselli July 15, 2014 #CSSSummit