Forum Moderators: not2easy

Message Too Old, No Replies

problem with CSS (printing) and browsers

problem with CSS (printing) and browsers

         

mavrick

12:35 pm on Jun 4, 2003 (gmt 0)

10+ Year Member



hi all

this is agreat site and i have lernt a lot from it. thanks alot everbody.

Problem:

i have set up the website i am working on to print using css, and as said on the other postings the code only works on ie6. in my webpage i reference to two style sheets, which is fine,in ie6 but it does not work on other early web browers (ie5.0, ie5.5). when i view the page in an early browser, the page seems to read only the one style sheet.

is there any way one can tell the browser which style sheet to read first.

i would not mind if the user, using the site with ie5.0 can not print.

i hope i have written my problem out clearly

thanks in advance

BlobFisk

1:38 pm on Jun 4, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to WebmasterWorld, mavrick!

Unusual! The browsers read in the stylesheets in the order that they are presented to them in the html. But, if I read your post correctly, you are not getting the print stylesheet to work? Have you the media="print" for the print stylesheet call?

mavrick

1:52 pm on Jun 4, 2003 (gmt 0)

10+ Year Member



hi

thanks for your prompt reply.

i got the print css to work. when i call the the page up in an early vision of ie the page calls the print css before it call my css. so the the side menu and the top menu are hidden.

here is the code i f=have for both css:

my css:

sidemenu {position:absolute;
left:0;
top:70;
visibility: display;
}

.topmenu {position:absolute;
left:178;
top:70;
visibility: display;
}

.Content {position:relative;
left:70;
height:338;
width:610;
overflow:scroll;
}

print css:

.topmenu {
visibility: hidden;
}
.Content {
position: absolute;
top: 80px;
left:0px;
padding:10px;
overflow:none;
}
.sidemenu {
visibility: hidden;
}

i have also tryed toplace the print css above my css but still there is a problem.

thanks

BlobFisk

1:54 pm on Jun 4, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Could you post the the 2 HTML calls for your CSS pages? maybe the problem is there...

mavrick

6:21 am on Jun 5, 2003 (gmt 0)

10+ Year Member



hi
here is how i call the 2 css files

<style type="text/css" media="print">@import url(/print.css); </style>

<style type="text/css" media="screen">@import url(/my.css); </style>

BlobFisk

9:55 am on Jun 5, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Early browsers don't work with the @import rule - you may need to consider using <link> to call in your stylesheets.

mavrick

11:27 am on Jun 5, 2003 (gmt 0)

10+ Year Member



hi

thanks guys is works fine:>

thanks a lot

mavrick

kennybud416

11:51 pm on Jun 13, 2003 (gmt 0)

10+ Year Member



I have the same problem however I tired the following code in my xsl file.

Currently I'm having a problem with the way a Mac prints a file and a way a PC prints a file. The PC prints fine. However a Mac's font print out is way to small. Therefore I have different .ccs files when the xsl file is loaded. Could you please let me know why the following doesn't work? Right now this code defaults to whatever is under the else clause.

I also tried to put these lines under in between the <script language="JavaScript1.2">,</script> tags. However I don't get any outputs.

FYI: I'm new to ccs and xsl.

<head>
if (navigator.userAgent.toLowerCase().indexOf("mac")!=-1) {
 document.write("<link rel='stylesheet' href='macstyles.css' type='text/css'>");
} else {
 document.write("<link rel='stylesheet' href='pcstyles.css' type='text/css'>");
}
</head>

what my script tags look like. The code above doesn't work when placed in between:

<script language="JavaScript1.2">
<xsl:comment>
<xsl:call-template name="js"/>
<xsl:text>// </xsl:text>
</xsl:comment>
</script>