Matt Overall
Matt Overall

Reputation: 329

Force browser to render webpage's Print stylesheet

A lot of web pages use a Print stylesheet to format things better for printing. My question is, is it possible to force the browser to render a page using the print stylesheet without actually printing it?

Upvotes: 12

Views: 10972

Answers (2)

Sal Ferrarello
Sal Ferrarello

Reputation: 270

In Chrome (version 78), you can force the browser to render the webpage's print stylesheet using Chrome DevTools by going to More Tools > Rendering

Open Chrome DevTools Rendering Settings

then selecting the Print option in the Emulate CSS Media dropdown

Emulate print media checkbox in Chrome DevTools

Upvotes: 15

Eonasdan
Eonasdan

Reputation: 7765

usually the print css has a media type of print. simply remove the media definition and use it in replace of the main style sheet

<link rel="stylesheet" type="text/css" media="print" href="print.css" />

change to

<link rel="stylesheet" type="text/css" media="all" href="print.css" />

Upvotes: 3

Related Questions