tags:

views:

34

answers:

2

Is there some syntax I can use in my media="print" CSS which will make one div element cover an entire printed page?

<div id="important_thing">Important!</div>
<ol id="other_stuff">
  <li>Thing</li>
  <li>blah</li>
</ol>

print.css

#important_thing {
  width:100%;
  height:100%;
}

#other_stuff li {
  float:left;
  width:20pt;
  height:8pt;
}

This doesn't have the desired effect. I'd like to have an entire page for 'important stuff' and as many other pages as required for all the list elements.

Any ideas?

A: 

id="important_thing" name="important_thing" style="height:10cm; width:10cm;">Important

this is working

zod
Um… this needs fixing.
Samir Talwar
If you see misinformation, vote it down. Add comments indicating what, specifically, is wrong. Provide better answers of your own. Best of all — edit and improve the existing questions and answers!
zod
I did vote it down. The problem is that your HTML is incomplete and pretty unreadable, the `name` attribute is useless, and even after I figured out I should be adding it to the `<div>` in the question, it still doesn't take into account the fact that different printers use different paper sizes. I would love to add my own answer, but Traingamer beat me to it.
Samir Talwar
+2  A: 

Use a page-break-after

http://www.w3schools.com/CSS/pr_print_pageba.asp

#important_thing { 
  width:100%; 
  height:100%;
  page-break-after:always 
}

You may have to combine it with a page-break-before:always

Traingamer