Skip to content

Instantly share code, notes, and snippets.

@ebbnormal
Created October 17, 2015 00:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ebbnormal/e0cd23df03798d5bfa9c to your computer and use it in GitHub Desktop.
Save ebbnormal/e0cd23df03798d5bfa9c to your computer and use it in GitHub Desktop.
/* CSS Document */
/* GoJS Printing*/
/* @media print specifies CSS rules that only apply when printing */
@media print {
/* CSS reset to clear styles for printing */
html, body, div {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
/* Hide everything on the page */
body * {
display: none !important;
}
#content, #myImages, #myImages * {
/* Only display the images we want printed */
/* all of the image's parent divs
leading up to the body must be un-hidden (displayed) too
*/
display: block;
/* CSS reset to clear the specific visible divs for printing */
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
/* We have line breaks in the DIV
to separate the images in the browser,
but do not want those line breaks when printing
*/
#myImages br {
display: none;
}
img {
/* Only some browsers respect this rule: */
page-break-inside: avoid;
/* Almost all browsers respect this rule: */
page-break-after:always;
}
}
/* The @page rules specify additional printing directives that browsers may respect
Here we suggest printing in landscape (instead of portrait) with a small margin.
Browsers, however, are free to ignore or override these suggestions.
See also:
https://developer.mozilla.org/en-US/docs/CSS/@page
http://dev.w3.org/csswg/css3-page/#at-page-rule
*/
@page {
/* Some browsers respect rules such as size: landscape */
margin: 1cm;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment