Skip to content

Instantly share code, notes, and snippets.

@fabiorochafg
Last active December 1, 2016 16:57
Show Gist options
  • Save fabiorochafg/5554099 to your computer and use it in GitHub Desktop.
Save fabiorochafg/5554099 to your computer and use it in GitHub Desktop.
A print stylesheet example.
@media print {
*,
*:before,
*:after,
*:first-letter,
p:first-line,
div:first-line,
blockquote:first-line,
li:first-line {
background: transparent !important;
box-shadow: none !important;
color: #000 !important;
margin: 0 !important;
padding: 0 !important;
text-shadow: none !important;
}
a,
a:visited {
text-decoration: underline;
}
a:after {
content: " ("attr(href)")";
}
a[href^="javascript:"]:after,
a[href^="#"]:after {
content: "";
}
abbr[title]:after {
content: " ("attr(title)")";
}
body {
color: #000;
font: 9pt serif;
line-height: 1.4em;
}
h1 {
width: 100%;
}
h1 a:after {
content: "";
}
img {
max-width: 100%;
}
p {
orphans: 3;
widows: 3;
}
p a {
word-wrap: break-word;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment