In the spirit of sharing, here are a few rules that I regularly use. They fit well in SemanticUI, but may be useful elsewhere.
[class*="printed only"] { display: none; } @media print { .printed { display: initial !important; opacity: 1 !important; } [class*="non printed"] { display: none !important; opacity: 0 !important; } }
Screen display and printing
Use class="printed" . This is useful if you have tabs in the user interface, so you can make them print even if they are not currently displayed.
Display on screen but not print
Use class="non printed" . This is useful for navigation items and other materials that you do not want to print.
Do not display on screen, but print
Use class="printed only" . Itβs convenient for me to include some metadata about the web page in the print version, which may not be relevant for the web version β for example, the date / time the page was created, the username of the person who printed the document, the link (if it is removed from the headers), and so on.
Algy Taylor Dec 14 '16 at 13:52 2016-12-14 13:52
source share