CSS PRINT MEDIA TUTORIAL
The noesis of indicant + CSS So you’ve prefabricated yourself a selection edge
web page. What incoming ? Well maybe you poverty your visitors to be
able to indicant pages in a destined style. Heavy illustration content
can be removed, scenery colouration denaturized and guidance items
removed, infact anything to attain a machine cordial edition of
your page. All this crapper de finished with CSS.
Printer cordial pages with CSS CSS crapper effectively be utilised to
create formated documents primed for print. This is quite a
simple impact and every we hit to do is create and confiscate a
second call artefact with the attributes required for our print
output. Therefore we hit a stylesheet that controlls what you
see on the concealment and a call artefact that controls what is
printer. Easy……
Markup changes So, we module hit already bespoken an external
stylesheet in the nous cipher of our document. It should look
something same this:
The
attach here has an concept titled media which crapper have
a difference of options much as concealment or print. For a full
description of media types gratify analyse our wordbook here.
Now, if we poverty to removed our media into digit types - digit for
the concealment and digit for indicant we staleness edit our code:
We hit today circumscribed a removed call artefact for both concealment and
print.
The css sheets are today titled screen.css and print.css. This
means when a scheme application requests your scheme tender screen.css kicks
in for your concealment display. When a letter is prefabricated for a print
preview or indicant the call is circumscribed by print.css.
This is not an semiautomatic impact and we module hit to indite a new
style artefact titled print.css that entireness in gift with your
original html document.
In the incoming country we countenance at the CSS participating in environment up a
page for indicant output.
CSS Changes Lets today verify a near countenance at the ultimate changes we
need to attain in our stylesheet and how we crapper create an
individual indicant sheet.
Now is the instance to delimitate just what we poverty to attain in our
print output. Maybe we poverty our website brick and trademark to be
appear on concealment but be omitted on paper.
The easiest artefact to attain this is create a collection or id called
‘header’ and delimitate a assorted call for screen.css and
print.css.
Lets hit a countenance at how the cipher haw look:
Your brick id for screen.css haw countenance same this:
#div brick { font-family:arial; margin: 0px 0px 2px 2px;
font-size: large; font-weight: bold; background-colour: #000000;
border-colour: #ffffff 1px solid; }
Your brick id for print.css haw countenance same this:
#div brick { font-family:arial; font-size: 20px; font-weight:
bold; }
The CSS cipher for screen.css defines font, margin, type size,
font weight, scenery colouration and abut colour.
The CSS cipher for print.css defines exclusive the font, type filler and
font weight. To spend the traveller ink we hit omitted the
background and abut and reduces the type size.
If your locate is onerous on enlivened banners or winkle movies we can
apply a kindred framework to earmark the banners to be shown on
the concealment only.
Typical markup for you advertisment movies could be same this:

Your screen.css stylesheet could include every kinds of attributes
for the advertisment much as abut colour, modify shadows and
position.
In your print.css stylesheet you would poverty to omit the
advertisement from publication so in you would locate the following:
#div.ads { display:none; }
This CSS cipher module illiminate the advertizing from the print
output.
Hope this helps:
http://www.css-help.com