Friday, August 1, 2008

CSS controls printing

Cascade Style Sheet is very important in designing your HTML. It gives you exact sizes. Besides font size, you can also spice up your <table> and much much more. Recently I learned that you can also control paging in printing too. Try this.

<style>
.pagebreak
{
page-break-after: always
}
</style>

<u>Page 1</u>
<p>
There are a few CSS styles that can control paging. Though you only see 1 page here on browser, however if you print it, you will see multiple pages.

<div class="pagebreak"></div>

<u>Page 2</u>
<p>
There are other styles that you may use to control printing, including preventing your elements from chopping in half at end of your page.
See <a href="http://www.w3schools.com/CSS/css_ref_print.asp">here</a> for details

No comments: