page- break-before和page-break-after
CSS屬性并不會修改網頁在屏幕上的顯示,這兩個屬性是用來控制文件的打印方式。每個打印屬性都可以設定4種設定值:auto、always、left和
right。其中Auto是默認值,只有在有需要時,才需設定分頁符號 (Page
breaks)。page-break-before若設定成always,則是在遇到特定的組件時,打印機會重新開始一個新的打印頁。page-
break-before若設定成left,則會插入分頁符號,直到指定的組件出現在一個左邊的空白頁上。page-break-before若設定成
right,則會插入分頁符號,直到指定的組件出現在一個右邊的空白頁上。page-break-after屬性會將分頁符號加在指定組件后,而非之前。
在下列程序中您將可以看到這些屬性的設定。
<HTML>
<HEAD>
<TITLE>Listing 14-4</TITLE>
</HEAD>
<BODY>
<DIV>This is the first DIV.</DIV>
<DIV STYLE="page-break-before:always">This is the second DIV.</DIV>
<DIV STYLE="page-break-after:always">This is the third DIV.</DIV>
<DIV>This is the fourth DIV.</DIV>
<DIV STYLE="page-break-before:right">This is the fifth DIV.</DIV>
<DIV STYLE="page-break-after:right">This is the sixth DIV.</DIV>
<DIV>This is the last DIV.</DIV>
</BODY>
</HTML>
轉自 http://www.cnblogs.com/JustinYoung/articles/710734.html

]]>