[sclug] CSS

Jonathan Leighton lists at turnipspatch.com
Thu Oct 20 10:39:11 UTC 2005


On Thu, 2005-10-20 at 11:24 +0100, Chris Aitken wrote:
> > You seem to want CSS to allow you to create print result. The 
> > web is not a print medium. This is why CSS behaves the way it 
> > does. I recommend reading this: 
> > http://www.grauw.nl/articles/css-faq.php
> 
> Yes and no. You can create a print style sheet, which most browsers will use
> when orinting, or print previewing.
> Setting the following (or similar) in the head will allow the use of the
> print stylesheet.
> 
> 	<link rel="stylesheet" type="text/css" media="print"
> href="a/c/print.css" />
> 	<style type="text/css" media="screen">
> 		@import url(a/c/new_css.css);
> 	</style>
> 
> This way you can set a stylesheet X pixels wide etc to fit onto the width of
> the required paper. A good web designer will take all this into
> consideration.

Unless you specifically say otherwise (through the white-space
property[1], for instance), the text is going to wrap anyway. But you
are correct, you *can* have a print stylesheet, but the web is *still*
not a print medium. No print designer is going to use CSS to lay out
their page because print design requires far more precision than CSS
will ever allow. So the print stylesheet just allows *web* pages to be
printed in a fashion more suitable for reading off a piece of paper.

[1] http://www.w3.org/TR/CSS21/text.html#white-space-prop

> Also, depending on how one writes the @import depends on which browsers will
> cope well, or not at all. The above will work with all 4series browsers (inc
> NN4.7). It might not be as pretty [1] as a modern browser [2], but the
> result will be useable none the less. Of course - you have to ensure that
> your divs are in the right order, as older browsers will render them in a
> top down order.

Whilst true, that's not a standard. That's just the result of various
broken CSS parsers that have and still do exist. Anyway, there's a list
here: http://imfo.ru/csstest/css_hacks/import.php

-- 
Jonathan Leighton
http://turnipspatch.com/ | http://digital-proof.org/



More information about the Sclug mailing list