CSS Print Stylesheet:-
many of us working on css to style web page for the visitors
you may added this line before in your page
<link rel="stylesheet" type="text/css" href="cssfile.css" />
ok the css file now will affect the screen but what if we want the css affect the print
yes we want the visitor print the page but without the menu , advertisement .. etc
ok we will now create a css file and we will name it print.css
now add this line to your page
<link rel="stylesheet" type="text/css" href="print.css" media="print" />
do you notice someting ??
yes , media=”print” this tells the browser to use this css file when print
concepts of print style sheet:-
1- adjust body margin
adjust the body margin so printed page margin will be as you want not the browser default
you can use this for example
body{margin:0;
border:1px solid #000000;
}
2- use one measure for your fonts and line height and related things:
you must use one measure for font size and related things like pt , em so it can display good on your printer