SlideShare a Scribd company logo
CSS GOING TO PRINT
CSS can be used to specify  how a document is presented   in different media .
We can determine which CSS rules are given to specific devices using the  media attribute :  <link rel=&quot;stylesheet” href=&quot; a. css” type=&quot; te xt/css&quot;  media=&quot; sc reen&quot;  /> <link rel=&quot;stylesheet” href=&quot; a. css&quot; type=&quot; te xt/css&quot;  media=&quot; print &quot;  /> <link rel=&quot;stylesheet” href=&quot; a. css&quot; type=&quot; te xt/css&quot;  media=” handheld &quot;  />
So, what are possible media types?
There are  ten media types  defined in CSS 2.1
suitable for all devices for speech synthesizers for Braille tactile feedback devices for paged Braille printers for handheld devices for print material for projected presentations for color computer screens for teletypes and terminals for television type devices all aural braille embossed handheld print projection screen tty tv
Can you  specify more than one at the same time?
Yes, you can use  multiple media types  within the one attribute: <link rel=&quot;stylesheet” href=&quot; a. css” type=&quot; te xt/css&quot;  media=&quot; sc reen, print&quot;  />
Are there different  methods we  can use?
There are  five methods  that can be used to specify media  for style sheets.
However, some methods are complex, and other can cause issues in some browsers, so we will only look at the  two safest methods .
Method 1:  <link> within HTML
You can use a  <link> element  in the head of your HTML document to specify the target media of an external style sheet. <link rel=&quot;stylesheet” href=&quot; a. css” type=&quot; te xt/css&quot;  media=&quot;print&quot;  />
Method 2: @media within CSS
You can specify the target medium within a CSS file using  @media @media  screen   { body { color: blue; } }
What is this @media?
At-rules  start with an ' @ ' character followed immediately  by an identifier (such as “media” or “import”).
In CSS2.1 there are  four possible at-rules :  - @charset - @import - @media - @page
We are only going to look at @media now, and focus on  how it can be used to deliver CSS to printers .
@media rules can  sit  anywhere inside  your  external CSS style sheet. body { color: red; } @media  screen   { body { color: blue; } }
@media rules include the @media statement, followed by a media type,  followed by a start and end bracket . @media screen  { }
Any standard CSS rule can be  added inside these brackets . @media screen  { p { color: red; } #nav { float: left; } .intro { font-weight: bold; } }
You can specify more than one media type using @media rules. Each media type must be  separated by a comma . @media  screen, print   { p { color: red; } #nav { float: left; } }
How does @media work?
1. Different devices (such as browsers, printers and mobiles) will see the  <link> element in the HTML file . <link rel=&quot;stylesheet” href=&quot; a. css” type=&quot; te xt/css&quot;  media=”all&quot;  />
2. These devices will then  look at the CSS file .
3. The CSS file can included one or more @media rules,  each targeting a different device .  @media  screen  { } @media  print  { } @media  handheld  { }
4. Each device will  only read the rules assigned to it , based on the media type.  @media screen { } @media print { } @media handheld { }
If you want to specify more than one media type inside your CSS file, make sure your <link> element uses a  media type of “all” . <link rel=&quot;stylesheet” href=&quot; a. css” type=&quot; te xt/css&quot;  media=”screen&quot;  /> <link rel=&quot;stylesheet” href=&quot; a. css” type=&quot; te xt/css&quot;  media=”all&quot;  />
Otherwise all the other different types of devices will not look inside the CSS file at all.
Why use @media?
The main advantage of @media is that you only need one CSS file, and it can be used to control  all the different media . @media  screen  { } @media  print  { } @media  handheld  { }
This means there are less hits to the server, and  only one link in your HTML files , which makes maintenance easier. <link rel=&quot;stylesheet” href=&quot; a. css” type=&quot; te xt/css&quot;  media=”print&quot;  /> <link rel=&quot;stylesheet” href=&quot; a. css” type=&quot; te xt/css&quot;  media=”all&quot;  />
So, let’s talk about print CSS
Trying to set up print CSS can often be  very frustrating  for designers and developers.
There are a wide variety of  different solutions  to deal with: Different operating systems Different browsers Different printers Different colour options
There are also a range of printing  issues  to deal with: Background images not printing Background colors not printing Printing first page only Broken page layouts
Decision:  Replicate or reduce
The two main  main options  for printing are: Replicate what is on screen Reduce to a print friendly version
Option 1:  Replicating what is on screen
To allow your pages to appear the same in print as on screen, you can  simple adjust the media type .
Add  an additional media type to your @import rule. @media screen,  print  { }
However, you should be aware that  things are never that easy !
Background images and colors  will not print for users as a default. This can make your screen design look odd when printed.
Floats and absolutely  positioned elements can sometimes cut off after the first page (especially in some version of FireFox)
Layouts can sometimes cut off look  squashed  when printed.
Although it sounds more complicated, it is often much easier to  deliver a print friendly version .
Option 2: Create new,  simpler rules for printers only
Linking to print CSS Target: Screen and print <link rel=&quot;stylesheet” href=” master.css &quot; type=&quot;text/css”>
Create two @media rules - one  for screen and one for print . @media screen {  /* screen rules here */  } @media print  { /* print rules here */  }
Any tips for simple print CSS?
Here are  some pointers  for easy print friendly pages.
Tip 1:  Convert colors to black and white where possible. h1, h2, h3, h4, h5, h6  {  color: #000;  }
Tip 2:  Hide sections of the page that  are unnecessary. #navigation, #sidebar, #adbanner, #richfooter {  display: none;  }
Tip 3:  Convert links to default text color and style - if you want! a:link, a:visited { color: #000; text-decoration: none; }
Tip 4:  Avoid floats, absolute positioning and height 100%. #container {  float: none;  }
Tip 5:  Keep it simple! Remember that the goal is to create a page that is easy to print and read.
Russ Weakley Max Design Site:  maxdesign.com.au Twitter:  twitter.com/russmaxdesign Slideshare:  slideshare.net/maxdesign Linkedin:   linkedin.com/in/russweakley

More Related Content

What's hot

Advance HTML
Advance HTMLAdvance HTML
Advance HTML
VijaySingh790398
 
CSS Basics
CSS BasicsCSS Basics
CSS Basics
WordPress Memphis
 
Html heading
Html headingHtml heading
Html headingsaichii27
 
Html introduction
Html introductionHtml introduction
Html introduction
Dalia Elbadry
 
Html table tags
Html table tagsHtml table tags
Html table tags
eShikshak
 
Introduction to Cascading Style Sheets (CSS)
Introduction to Cascading Style Sheets (CSS)Introduction to Cascading Style Sheets (CSS)
Introduction to Cascading Style Sheets (CSS)
Chris Poteet
 
CSS - Text Properties
CSS - Text PropertiesCSS - Text Properties
CSS - Text Propertieshstryk
 
Introduction to CSS
Introduction to CSSIntroduction to CSS
Introduction to CSS
Folasade Adedeji
 
HTML Tags
HTML TagsHTML Tags
HTML Tags
Mirza Obaid
 
3 Layers of the Web - Part 1
3 Layers of the Web - Part 13 Layers of the Web - Part 1
3 Layers of the Web - Part 1
Jeremy White
 
Html basic tags
Html basic tagsHtml basic tags
Html basic tags
umesh patil
 
Basic html
Basic htmlBasic html
cascading style sheet ppt
cascading style sheet pptcascading style sheet ppt
cascading style sheet ppt
abhilashagupta
 
JavaScript & Dom Manipulation
JavaScript & Dom ManipulationJavaScript & Dom Manipulation
JavaScript & Dom Manipulation
Mohammed Arif
 
Html frames
Html framesHtml frames
Html frames
eShikshak
 
Html Basic Tags
Html Basic TagsHtml Basic Tags
Html Basic Tags
Richa Singh
 

What's hot (20)

HTML: Tables and Forms
HTML: Tables and FormsHTML: Tables and Forms
HTML: Tables and Forms
 
Html Ppt
Html PptHtml Ppt
Html Ppt
 
Advance HTML
Advance HTMLAdvance HTML
Advance HTML
 
CSS Basics
CSS BasicsCSS Basics
CSS Basics
 
Html ppt
Html pptHtml ppt
Html ppt
 
Html heading
Html headingHtml heading
Html heading
 
Html introduction
Html introductionHtml introduction
Html introduction
 
Html table tags
Html table tagsHtml table tags
Html table tags
 
Introduction to Cascading Style Sheets (CSS)
Introduction to Cascading Style Sheets (CSS)Introduction to Cascading Style Sheets (CSS)
Introduction to Cascading Style Sheets (CSS)
 
CSS - Text Properties
CSS - Text PropertiesCSS - Text Properties
CSS - Text Properties
 
Introduction to CSS
Introduction to CSSIntroduction to CSS
Introduction to CSS
 
HTML Tags
HTML TagsHTML Tags
HTML Tags
 
3 Layers of the Web - Part 1
3 Layers of the Web - Part 13 Layers of the Web - Part 1
3 Layers of the Web - Part 1
 
Html basic tags
Html basic tagsHtml basic tags
Html basic tags
 
Basic html
Basic htmlBasic html
Basic html
 
cascading style sheet ppt
cascading style sheet pptcascading style sheet ppt
cascading style sheet ppt
 
Html Frames
Html FramesHtml Frames
Html Frames
 
JavaScript & Dom Manipulation
JavaScript & Dom ManipulationJavaScript & Dom Manipulation
JavaScript & Dom Manipulation
 
Html frames
Html framesHtml frames
Html frames
 
Html Basic Tags
Html Basic TagsHtml Basic Tags
Html Basic Tags
 

Viewers also liked

Generating print output from DITA using CSS
Generating print output from DITA using CSSGenerating print output from DITA using CSS
Generating print output from DITA using CSS
Jim Mandas
 
Javascript - Array - Creating Array
Javascript - Array - Creating ArrayJavascript - Array - Creating Array
Javascript - Array - Creating Array
Samuel Santos
 
Javascript arrays
Javascript arraysJavascript arrays
Javascript arrays
Hassan Dar
 
How to Create an Array & types in PHP
How to Create an Array & types in PHP How to Create an Array & types in PHP
How to Create an Array & types in PHP
Ajit Sinha
 
Cloud computing
Cloud computingCloud computing
Cloud computing
Ajit Sinha
 
BrailleTap
BrailleTapBrailleTap
BrailleTap
Tiago Guerreiro
 
Nested lists in HTML
Nested lists in HTMLNested lists in HTML
Nested lists in HTML
fryajust
 
Braile
BraileBraile
JavaScript Arrays
JavaScript Arrays JavaScript Arrays
JavaScript Arrays
Reem Alattas
 
Javascript (parte 1)
Javascript (parte 1)Javascript (parte 1)
Javascript (parte 1)
Alex Camargo
 
Cascading Style Sheets - Part 02
Cascading Style Sheets - Part 02Cascading Style Sheets - Part 02
Cascading Style Sheets - Part 02
Hatem Mahmoud
 
Cascading Style Sheets - Part 01
Cascading Style Sheets - Part 01Cascading Style Sheets - Part 01
Cascading Style Sheets - Part 01
Hatem Mahmoud
 
How Cascading Style Sheets (CSS) Works
How Cascading Style Sheets (CSS) WorksHow Cascading Style Sheets (CSS) Works
How Cascading Style Sheets (CSS) Works
Amit Tyagi
 
Braille Presentation
Braille Presentation Braille Presentation
Braille Presentation anagd
 
Javascript
JavascriptJavascript
Javascript
guest03a6e6
 
Introduction to CSS
Introduction to CSSIntroduction to CSS
Introduction to CSS
Amit Tyagi
 

Viewers also liked (20)

Generating print output from DITA using CSS
Generating print output from DITA using CSSGenerating print output from DITA using CSS
Generating print output from DITA using CSS
 
Javascript by geetanjali
Javascript by geetanjaliJavascript by geetanjali
Javascript by geetanjali
 
Javascript - Array - Creating Array
Javascript - Array - Creating ArrayJavascript - Array - Creating Array
Javascript - Array - Creating Array
 
Javascript arrays
Javascript arraysJavascript arrays
Javascript arrays
 
How to Create an Array & types in PHP
How to Create an Array & types in PHP How to Create an Array & types in PHP
How to Create an Array & types in PHP
 
Cloud computing
Cloud computingCloud computing
Cloud computing
 
BrailleTap
BrailleTapBrailleTap
BrailleTap
 
Nested lists in HTML
Nested lists in HTMLNested lists in HTML
Nested lists in HTML
 
Braile
BraileBraile
Braile
 
JavaScript Arrays
JavaScript Arrays JavaScript Arrays
JavaScript Arrays
 
Javascript (parte 1)
Javascript (parte 1)Javascript (parte 1)
Javascript (parte 1)
 
Ecommerce final
Ecommerce finalEcommerce final
Ecommerce final
 
Cascading Style Sheets - Part 02
Cascading Style Sheets - Part 02Cascading Style Sheets - Part 02
Cascading Style Sheets - Part 02
 
Cascading Style Sheets - Part 01
Cascading Style Sheets - Part 01Cascading Style Sheets - Part 01
Cascading Style Sheets - Part 01
 
How Cascading Style Sheets (CSS) Works
How Cascading Style Sheets (CSS) WorksHow Cascading Style Sheets (CSS) Works
How Cascading Style Sheets (CSS) Works
 
Braille Presentation
Braille Presentation Braille Presentation
Braille Presentation
 
Css Ppt
Css PptCss Ppt
Css Ppt
 
Javascript
JavascriptJavascript
Javascript
 
Introduction to CSS
Introduction to CSSIntroduction to CSS
Introduction to CSS
 
Js ppt
Js pptJs ppt
Js ppt
 

Similar to Print CSS

CSS media types
CSS media typesCSS media types
CSS media types
Russ Weakley
 
Cascading Style Sheets - CSS - Tutorial
Cascading Style Sheets - CSS  -  TutorialCascading Style Sheets - CSS  -  Tutorial
Cascading Style Sheets - CSS - Tutorial
MSA Technosoft
 
INTRODUCTIONS OF CSS
INTRODUCTIONS OF CSSINTRODUCTIONS OF CSS
INTRODUCTIONS OF CSS
SURYANARAYANBISWAL1
 
WELCOME-FOLKS--CSS.-AND-HTMLS.pptx
WELCOME-FOLKS--CSS.-AND-HTMLS.pptxWELCOME-FOLKS--CSS.-AND-HTMLS.pptx
WELCOME-FOLKS--CSS.-AND-HTMLS.pptx
HeroVins
 
Lesson 8 Computer Creating your Website.pdf
Lesson 8 Computer Creating your Website.pdfLesson 8 Computer Creating your Website.pdf
Lesson 8 Computer Creating your Website.pdf
AshleyJovelClavecill
 
CSS3 Media Queries
CSS3 Media QueriesCSS3 Media Queries
CSS3 Media Queries
Russ Weakley
 
Pfnp slides
Pfnp slidesPfnp slides
Pfnp slides
William Myers
 
Using a CSS Framework
Using a CSS FrameworkUsing a CSS Framework
Using a CSS Framework
Gareth Saunders
 
Basics Of Css And Some Common Mistakes
Basics Of Css And Some Common MistakesBasics Of Css And Some Common Mistakes
Basics Of Css And Some Common Mistakessanjay2211
 
Intermediate Web Design.doc
Intermediate Web Design.docIntermediate Web Design.doc
Intermediate Web Design.docbutest
 
Intermediate Web Design.doc
Intermediate Web Design.docIntermediate Web Design.doc
Intermediate Web Design.docbutest
 
Css
CssCss
HTML & CSS Workshop Notes
HTML & CSS Workshop NotesHTML & CSS Workshop Notes
HTML & CSS Workshop Notes
Pamela Fox
 
Chapter 3 - CSS.pdf
Chapter 3 - CSS.pdfChapter 3 - CSS.pdf
Chapter 3 - CSS.pdf
wubiederebe1
 
Team styles
Team stylesTeam styles
Team styles
nathanscott
 

Similar to Print CSS (20)

CSS media types
CSS media typesCSS media types
CSS media types
 
Css
CssCss
Css
 
Css
CssCss
Css
 
CSS
CSSCSS
CSS
 
Cascading Style Sheets - CSS - Tutorial
Cascading Style Sheets - CSS  -  TutorialCascading Style Sheets - CSS  -  Tutorial
Cascading Style Sheets - CSS - Tutorial
 
INTRODUCTIONS OF CSS
INTRODUCTIONS OF CSSINTRODUCTIONS OF CSS
INTRODUCTIONS OF CSS
 
Css intro
Css introCss intro
Css intro
 
Css
CssCss
Css
 
WELCOME-FOLKS--CSS.-AND-HTMLS.pptx
WELCOME-FOLKS--CSS.-AND-HTMLS.pptxWELCOME-FOLKS--CSS.-AND-HTMLS.pptx
WELCOME-FOLKS--CSS.-AND-HTMLS.pptx
 
Lesson 8 Computer Creating your Website.pdf
Lesson 8 Computer Creating your Website.pdfLesson 8 Computer Creating your Website.pdf
Lesson 8 Computer Creating your Website.pdf
 
CSS3 Media Queries
CSS3 Media QueriesCSS3 Media Queries
CSS3 Media Queries
 
Pfnp slides
Pfnp slidesPfnp slides
Pfnp slides
 
Using a CSS Framework
Using a CSS FrameworkUsing a CSS Framework
Using a CSS Framework
 
Basics Of Css And Some Common Mistakes
Basics Of Css And Some Common MistakesBasics Of Css And Some Common Mistakes
Basics Of Css And Some Common Mistakes
 
Intermediate Web Design.doc
Intermediate Web Design.docIntermediate Web Design.doc
Intermediate Web Design.doc
 
Intermediate Web Design.doc
Intermediate Web Design.docIntermediate Web Design.doc
Intermediate Web Design.doc
 
Css
CssCss
Css
 
HTML & CSS Workshop Notes
HTML & CSS Workshop NotesHTML & CSS Workshop Notes
HTML & CSS Workshop Notes
 
Chapter 3 - CSS.pdf
Chapter 3 - CSS.pdfChapter 3 - CSS.pdf
Chapter 3 - CSS.pdf
 
Team styles
Team stylesTeam styles
Team styles
 

More from Russ Weakley

Accessible chat windows
Accessible chat windowsAccessible chat windows
Accessible chat windows
Russ Weakley
 
Accessible names & descriptions
Accessible names & descriptionsAccessible names & descriptions
Accessible names & descriptions
Russ Weakley
 
A deep dive into accessible names
A deep dive into accessible namesA deep dive into accessible names
A deep dive into accessible names
Russ Weakley
 
What are accessible names and why should you care?
What are accessible names and why should you care?What are accessible names and why should you care?
What are accessible names and why should you care?
Russ Weakley
 
How to build accessible UI components
How to build accessible UI componentsHow to build accessible UI components
How to build accessible UI components
Russ Weakley
 
What is WCAG 2 and why should we care?
What is WCAG 2 and why should we care?What is WCAG 2 and why should we care?
What is WCAG 2 and why should we care?
Russ Weakley
 
Accessible states in Design Systems
Accessible states in Design SystemsAccessible states in Design Systems
Accessible states in Design Systems
Russ Weakley
 
Creating accessible modals and autocompletes
Creating accessible modals and autocompletesCreating accessible modals and autocompletes
Creating accessible modals and autocompletes
Russ Weakley
 
Building an accessible progressive loader
Building an accessible progressive loaderBuilding an accessible progressive loader
Building an accessible progressive loader
Russ Weakley
 
Accessibility in Design systems - the pain and glory
Accessibility in Design systems - the pain and gloryAccessibility in Design systems - the pain and glory
Accessibility in Design systems - the pain and glory
Russ Weakley
 
Accessible Inline errors messages
Accessible Inline errors messagesAccessible Inline errors messages
Accessible Inline errors messages
Russ Weakley
 
Accessible Form Hints and Errors
Accessible Form Hints and ErrorsAccessible Form Hints and Errors
Accessible Form Hints and Errors
Russ Weakley
 
What is accessibility?
What is accessibility?What is accessibility?
What is accessibility?
Russ Weakley
 
Accessibility in Pattern Libraries
Accessibility in Pattern LibrariesAccessibility in Pattern Libraries
Accessibility in Pattern Libraries
Russ Weakley
 
Accessibility in pattern libraries
Accessibility in pattern librariesAccessibility in pattern libraries
Accessibility in pattern libraries
Russ Weakley
 
Building an accessible auto-complete - #ID24
Building an accessible auto-complete - #ID24Building an accessible auto-complete - #ID24
Building an accessible auto-complete - #ID24
Russ Weakley
 
Building an accessible auto-complete
Building an accessible auto-completeBuilding an accessible auto-complete
Building an accessible auto-complete
Russ Weakley
 
Creating Acessible floating labels
Creating Acessible floating labelsCreating Acessible floating labels
Creating Acessible floating labels
Russ Weakley
 
Creating an Accessible button dropdown
Creating an Accessible button dropdownCreating an Accessible button dropdown
Creating an Accessible button dropdown
Russ Weakley
 
Creating a Simple, Accessible On/Off Switch
Creating a Simple, Accessible On/Off SwitchCreating a Simple, Accessible On/Off Switch
Creating a Simple, Accessible On/Off Switch
Russ Weakley
 

More from Russ Weakley (20)

Accessible chat windows
Accessible chat windowsAccessible chat windows
Accessible chat windows
 
Accessible names & descriptions
Accessible names & descriptionsAccessible names & descriptions
Accessible names & descriptions
 
A deep dive into accessible names
A deep dive into accessible namesA deep dive into accessible names
A deep dive into accessible names
 
What are accessible names and why should you care?
What are accessible names and why should you care?What are accessible names and why should you care?
What are accessible names and why should you care?
 
How to build accessible UI components
How to build accessible UI componentsHow to build accessible UI components
How to build accessible UI components
 
What is WCAG 2 and why should we care?
What is WCAG 2 and why should we care?What is WCAG 2 and why should we care?
What is WCAG 2 and why should we care?
 
Accessible states in Design Systems
Accessible states in Design SystemsAccessible states in Design Systems
Accessible states in Design Systems
 
Creating accessible modals and autocompletes
Creating accessible modals and autocompletesCreating accessible modals and autocompletes
Creating accessible modals and autocompletes
 
Building an accessible progressive loader
Building an accessible progressive loaderBuilding an accessible progressive loader
Building an accessible progressive loader
 
Accessibility in Design systems - the pain and glory
Accessibility in Design systems - the pain and gloryAccessibility in Design systems - the pain and glory
Accessibility in Design systems - the pain and glory
 
Accessible Inline errors messages
Accessible Inline errors messagesAccessible Inline errors messages
Accessible Inline errors messages
 
Accessible Form Hints and Errors
Accessible Form Hints and ErrorsAccessible Form Hints and Errors
Accessible Form Hints and Errors
 
What is accessibility?
What is accessibility?What is accessibility?
What is accessibility?
 
Accessibility in Pattern Libraries
Accessibility in Pattern LibrariesAccessibility in Pattern Libraries
Accessibility in Pattern Libraries
 
Accessibility in pattern libraries
Accessibility in pattern librariesAccessibility in pattern libraries
Accessibility in pattern libraries
 
Building an accessible auto-complete - #ID24
Building an accessible auto-complete - #ID24Building an accessible auto-complete - #ID24
Building an accessible auto-complete - #ID24
 
Building an accessible auto-complete
Building an accessible auto-completeBuilding an accessible auto-complete
Building an accessible auto-complete
 
Creating Acessible floating labels
Creating Acessible floating labelsCreating Acessible floating labels
Creating Acessible floating labels
 
Creating an Accessible button dropdown
Creating an Accessible button dropdownCreating an Accessible button dropdown
Creating an Accessible button dropdown
 
Creating a Simple, Accessible On/Off Switch
Creating a Simple, Accessible On/Off SwitchCreating a Simple, Accessible On/Off Switch
Creating a Simple, Accessible On/Off Switch
 

Recently uploaded

De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 

Recently uploaded (20)

De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 

Print CSS

  • 1. CSS GOING TO PRINT
  • 2. CSS can be used to specify how a document is presented in different media .
  • 3. We can determine which CSS rules are given to specific devices using the media attribute : <link rel=&quot;stylesheet” href=&quot; a. css” type=&quot; te xt/css&quot; media=&quot; sc reen&quot; /> <link rel=&quot;stylesheet” href=&quot; a. css&quot; type=&quot; te xt/css&quot; media=&quot; print &quot; /> <link rel=&quot;stylesheet” href=&quot; a. css&quot; type=&quot; te xt/css&quot; media=” handheld &quot; />
  • 4. So, what are possible media types?
  • 5. There are ten media types defined in CSS 2.1
  • 6. suitable for all devices for speech synthesizers for Braille tactile feedback devices for paged Braille printers for handheld devices for print material for projected presentations for color computer screens for teletypes and terminals for television type devices all aural braille embossed handheld print projection screen tty tv
  • 7. Can you specify more than one at the same time?
  • 8. Yes, you can use multiple media types within the one attribute: <link rel=&quot;stylesheet” href=&quot; a. css” type=&quot; te xt/css&quot; media=&quot; sc reen, print&quot; />
  • 9. Are there different methods we can use?
  • 10. There are five methods that can be used to specify media for style sheets.
  • 11. However, some methods are complex, and other can cause issues in some browsers, so we will only look at the two safest methods .
  • 12. Method 1: <link> within HTML
  • 13. You can use a <link> element in the head of your HTML document to specify the target media of an external style sheet. <link rel=&quot;stylesheet” href=&quot; a. css” type=&quot; te xt/css&quot; media=&quot;print&quot; />
  • 14. Method 2: @media within CSS
  • 15. You can specify the target medium within a CSS file using @media @media screen { body { color: blue; } }
  • 16. What is this @media?
  • 17. At-rules start with an ' @ ' character followed immediately by an identifier (such as “media” or “import”).
  • 18. In CSS2.1 there are four possible at-rules : - @charset - @import - @media - @page
  • 19. We are only going to look at @media now, and focus on how it can be used to deliver CSS to printers .
  • 20. @media rules can sit anywhere inside your external CSS style sheet. body { color: red; } @media screen { body { color: blue; } }
  • 21. @media rules include the @media statement, followed by a media type, followed by a start and end bracket . @media screen { }
  • 22. Any standard CSS rule can be added inside these brackets . @media screen { p { color: red; } #nav { float: left; } .intro { font-weight: bold; } }
  • 23. You can specify more than one media type using @media rules. Each media type must be separated by a comma . @media screen, print { p { color: red; } #nav { float: left; } }
  • 25. 1. Different devices (such as browsers, printers and mobiles) will see the <link> element in the HTML file . <link rel=&quot;stylesheet” href=&quot; a. css” type=&quot; te xt/css&quot; media=”all&quot; />
  • 26. 2. These devices will then look at the CSS file .
  • 27. 3. The CSS file can included one or more @media rules, each targeting a different device . @media screen { } @media print { } @media handheld { }
  • 28. 4. Each device will only read the rules assigned to it , based on the media type. @media screen { } @media print { } @media handheld { }
  • 29. If you want to specify more than one media type inside your CSS file, make sure your <link> element uses a media type of “all” . <link rel=&quot;stylesheet” href=&quot; a. css” type=&quot; te xt/css&quot; media=”screen&quot; /> <link rel=&quot;stylesheet” href=&quot; a. css” type=&quot; te xt/css&quot; media=”all&quot; />
  • 30. Otherwise all the other different types of devices will not look inside the CSS file at all.
  • 32. The main advantage of @media is that you only need one CSS file, and it can be used to control all the different media . @media screen { } @media print { } @media handheld { }
  • 33. This means there are less hits to the server, and only one link in your HTML files , which makes maintenance easier. <link rel=&quot;stylesheet” href=&quot; a. css” type=&quot; te xt/css&quot; media=”print&quot; /> <link rel=&quot;stylesheet” href=&quot; a. css” type=&quot; te xt/css&quot; media=”all&quot; />
  • 34. So, let’s talk about print CSS
  • 35. Trying to set up print CSS can often be very frustrating for designers and developers.
  • 36. There are a wide variety of different solutions to deal with: Different operating systems Different browsers Different printers Different colour options
  • 37. There are also a range of printing issues to deal with: Background images not printing Background colors not printing Printing first page only Broken page layouts
  • 38. Decision: Replicate or reduce
  • 39. The two main main options for printing are: Replicate what is on screen Reduce to a print friendly version
  • 40. Option 1: Replicating what is on screen
  • 41. To allow your pages to appear the same in print as on screen, you can simple adjust the media type .
  • 42. Add an additional media type to your @import rule. @media screen, print { }
  • 43. However, you should be aware that things are never that easy !
  • 44. Background images and colors will not print for users as a default. This can make your screen design look odd when printed.
  • 45. Floats and absolutely positioned elements can sometimes cut off after the first page (especially in some version of FireFox)
  • 46. Layouts can sometimes cut off look squashed when printed.
  • 47. Although it sounds more complicated, it is often much easier to deliver a print friendly version .
  • 48. Option 2: Create new, simpler rules for printers only
  • 49. Linking to print CSS Target: Screen and print <link rel=&quot;stylesheet” href=” master.css &quot; type=&quot;text/css”>
  • 50. Create two @media rules - one for screen and one for print . @media screen { /* screen rules here */ } @media print { /* print rules here */ }
  • 51. Any tips for simple print CSS?
  • 52. Here are some pointers for easy print friendly pages.
  • 53. Tip 1: Convert colors to black and white where possible. h1, h2, h3, h4, h5, h6 { color: #000; }
  • 54. Tip 2: Hide sections of the page that are unnecessary. #navigation, #sidebar, #adbanner, #richfooter { display: none; }
  • 55. Tip 3: Convert links to default text color and style - if you want! a:link, a:visited { color: #000; text-decoration: none; }
  • 56. Tip 4: Avoid floats, absolute positioning and height 100%. #container { float: none; }
  • 57. Tip 5: Keep it simple! Remember that the goal is to create a page that is easy to print and read.
  • 58. Russ Weakley Max Design Site: maxdesign.com.au Twitter: twitter.com/russmaxdesign Slideshare: slideshare.net/maxdesign Linkedin: linkedin.com/in/russweakley