Click to See Complete Forum and Search --> : CSS for Printers
difrad76
12-10-2004, 11:36 AM
I want to print document in Landscape. This the code I thought would accomplish this. It didn't. Is there anything else I could try?
<html>
<head>
<STYLE type="text/css">
@media print {
@page { size 8.5in 11in landscape ; margin: 2cm; writing-mode: tb-rl;}
BODY {font-size: 10pt; line-height: 120%; background: white;}
}
</style>
</head>
<body>
PRINT LANDSCAPE
</body>
</h
Neczy
12-10-2004, 12:36 PM
Hello,
The @page attribute, to my knowledge, only works in Opera, and its support in Opera is very buggy. It doesn't work in Internet Explorer or Mozilla so for the time being your best bet is to just not worry about it. Your best bet is to just make a little statement on your page saying to change your printer settings to print in landscape.
David Harrison
12-10-2004, 12:57 PM
Sure this:<style type="text/css" media="print">
</style>Or this:<style type="text/css">
@import "blah.css" print;
</style>Or this:<link rel="stylesheet" type="text/css" media="print" href="blah.css" />Would work for print media style sheets.
Neczy
12-10-2004, 01:15 PM
He wants to know how to automatically have it set to print in landscape though, instead of the normal portrait.
David Harrison
12-10-2004, 02:53 PM
Yes, but as you said @page{} is only (and badly) supported in Opera, so perhaps the landscape rule would work if it was applied via any of the methods I mentioned.
Neczy
12-10-2004, 04:12 PM
Ah, good point.
pawky
12-12-2004, 05:24 PM
ignoring the part that lavalamp mentioned (though you should try that as well ;)) but i also noticed that in your code you forgot the colon:
@page { size: 8.5in 11in landscape ;
Robert Wellock
12-13-2004, 11:50 AM
It used to work in Mozilla but they altered the UA to give the user more control.