Picto thématique

Rule n° 190 - The website offers styles dedicated to printing.

It is perfectly possible to predict how the web content of a page should be printed on paper. Style sheets for print media are there for that.

#Basics #Accessibility #Conception #Development #Presentation #Eco-conception

Goal

  • Allow content to be printed in a form that is appropriate to the medium.

Implementation

Provide a specific style sheet for the media type print, for example in the form: link rel="stylesheet" type="text/css" href="print.css" media="print" />.

Printing styles can correct a global style sheet (style sheet for all media or without mention of the media) or apply only for media print if the display style sheet is called by specifying the media print.

Find out more:

Control

This best practice can be quickly evaluated by testing the print preview in the browser, but confirmation needs the code to be inspected to find if a print style is present for the media print, which can be:

  • In the form of a tag of type <link rel="stylesheet" type="text/css" media="print" href="print.css" /> ;
  • In the form of a tag of type <style media="print" type="text/css">…</style> ;
  • In the form of a rule @media print {…} in an internal or external CSS;
  • Or in the form of a rule @import url("print.css") print; in an internal or external CSS.

By Opquast - Read the license


Discover Opquast training and certification

The objective of these rules and the Opquast community mission is ‘making the web better’ for your customers and for everyone! Opquast rules cover the key major areas of risk that can negatively affect website users such as privacy, ecodesign, accessibility and security.

Opquast training has already allowed over 19,000 web professionals to have their skills certified. Train your teams, contact us

We offer a 1 hour free discovery module.