CSS Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignCSS Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old April 21st, 2004, 10:55 AM
andyg1 andyg1 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 214 andyg1 User rank is Corporal (100 - 500 Reputation Level)andyg1 User rank is Corporal (100 - 500 Reputation Level)andyg1 User rank is Corporal (100 - 500 Reputation Level)andyg1 User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 2 Days 2 h 40 m 10 sec
Reputation Power: 10
Printing HTML - styles in print CSS ignored

Hi, I've got a webpage that I need to print almost exactly as it appears on the screen.

Currently I've got two style sheets linked to, one for the 'screen' and one for 'print'. I know this is working because the top line of my print CSS is:

@page {size: A4 landscape;}

however I can't seem to alter any of the elements on the print CSS. If I adjust the width, height, even the color it always inherits the stuff from the screen CSS and uses that, ignoring the print CSS. In fact, I can't even define a margin for my page using @page {margin...}.

The two style sheets look like this:

for the screen:
body {..... etc etc all works fine...

for the print:
@page {size: A4 landscape;margin:3cm;}
body {.... etc ALMOST same as above

the print CSS is essentially the same as the screen one, except that I want to define different widths and heights for table elements so I can fill an A4 page with a margin. The printing process ignores the widths and heights from the print CSS, and even ignores the margin definitions. It must be reading the print CSS because it knowns to print landscape.

What am I doing wrong, or am I completely misusing the @page and media commands?

Thanks in advance.
Andy
__________________
Time isn't wasted if you're wasted all the time

Reply With Quote
  #2  
Old April 21st, 2004, 11:13 AM
jbot's Avatar
jbot jbot is offline
a rootin', tootin', shootin'
Dev Shed Loyal (3000 - 3499 posts)
 
Join Date: Feb 2004
Location: location.href="hame"
Posts: 3,475 jbot User rank is Second Lieutenant (5000 - 10000 Reputation Level)jbot User rank is Second Lieutenant (5000 - 10000 Reputation Level)jbot User rank is Second Lieutenant (5000 - 10000 Reputation Level)jbot User rank is Second Lieutenant (5000 - 10000 Reputation Level)jbot User rank is Second Lieutenant (5000 - 10000 Reputation Level)jbot User rank is Second Lieutenant (5000 - 10000 Reputation Level)jbot User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 3 Weeks 2 Days 11 h 55 m 52 sec
Reputation Power: 94
you need to do this:

Code:
@page
{
     size: A4 landscape;
     margin:3cm;

     body
     {
          .... etc ALMOST same as above
     }
}


you see, the print media styles need to go inside the @page block, not come after it

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignCSS Help > Printing HTML - styles in print CSS ignored


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT