Here is a basic example of an HTML file available at this link: http://jsfiddle.net/WhupP/2/
The webpage consists of 4 main sections - header
, left-column
, righ-column
, and footer
.
Additionally, there are 2 @media
elements named screen
and print
.
When attempting to print the page, only the styles within @media screen{...}
are applied, causing the entire page to be printed. It is possible to exclude specific areas such as right-column
by adding a class like .noprint {display:none;}
to it.
My question is, can individual areas (out of the 5) be printed using CSS alone? If not achievable with CSS and requiring JavaScript, what would be the minimal JS code to achieve this task?
For instance, when printing the page (Ctrl+P or Command+P), I may want to print only area 2 and 3 on one occasion, solely area 2 another time, and just area 4 on a different occasion.