SitePoint Sponsor |
|
User Tag List
Results 1 to 4 of 4
-
Oct 2, 2007, 12:57 #1
- Join Date
- Dec 2004
- Location
- USA
- Posts
- 1,407
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
@media print - prints 3 pages in IE but 1 page in Firefox
When I print preview from Firefox, it shows it will print one page which is what I want. When print preview using Microsoft IE, it shows the page on one page but says it will print 2 pages, and actually prints three. The last two pages are blank.
Here's the code snippet in the page:
HTML Code:<link href="style.css" rel="stylesheet" type="text/css" /> .... <div class="class1"> <div class="class2">enough stuff to fill 3/4 page<div class="class2"> </ div class="class1">
HTML Code:@page { size 8.5in 11in; margin: 2cm } @media screen { body { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; } } @media print { body { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 8px; } @page { size 8.5in 11in; margin: 2cm } }
Last edited by WebDevGuy; Oct 2, 2007 at 13:47.
-
Oct 2, 2007, 14:48 #2
- Join Date
- Jan 2003
- Location
- Hampshire UK
- Posts
- 40,556
- Mentioned
- 183 Post(s)
- Tagged
- 6 Thread(s)
HI,
Can't really help you much here as my IE stand alone doesn't work in print preview anyway (unless you also have the problem in IE7).
Fix your code anyway - what is this?
[code]
</ div class="class1">
[code]
You can't add classes to closing tags.
I'm guessing your print problem is probably related to the way you have styled some elements. Make sure nothing is styled and then see what happens and then try narrowing the problem down by a process of elimination.
-
Oct 2, 2007, 14:49 #3
- Join Date
- Sep 2005
- Location
- Sydney, NSW, Australia
- Posts
- 16,875
- Mentioned
- 25 Post(s)
- Tagged
- 1 Thread(s)
Try leaving out the @page line and see if that fixes it.
Stephen J Chapman
javascriptexample.net, Book Reviews, follow me on Twitter
HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
<input name="html5" type="text" required pattern="^$">
-
Oct 2, 2007, 16:26 #4
- Join Date
- Dec 2004
- Location
- USA
- Posts
- 1,407
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I took the surrounding <div class="class1"> out and it worked - I don't know why but it did. (BTW, I did have </div> in the actual code)
Thanks for your help guys.
Bookmarks