A very headache problem about web print has fixed today,i am very glad because i have been doing this task for 1 month,that makes me sick,and i conclude like below:
1.according to different broswers ,the page-break is different,like firefox(2.0.0.4),it can be broken page by itself,so don't use any css and js to handle this,because all the job you done is useless,but one important thing is don't use the attribute of overflow=hidden in div,when you need a page-break during printing this div,the following content will be hidden,they can't be chaneged to another page.
but in ie6 or ie7,you should use the page-break-after (page-break-before)=always,this style is just for ie6,because in ie7 you should add another attribute in the page ,that is "<br>",so in ie7 you can write code like this:
<p style="page-break-before:always;"> <!--[if IE 7]><br style="height:0; line-height:0"><![endif]--></p>
2.the contents if you don't want to print to the paper,you can use the style like below to them
:@media print{ .notprint{ display:none; } }
so according to the browsers ,use the different styles,and don't forget in firefox ,the page can be broken by itself,if you can't see it ,that means the css you use is something wrong,check it.
good luck
|