Dear list,
I have been struggling with setting up a print style sheet for a website
and preventing some sections from printing.
This is top of my stylesheet:
<style type="text/css">
#navigation, #header, #picture, #impressum
{
display: none;
}
I would expect that this would prevent any content in the sections
#navigation, #header, #picture, #impressum from printing and this is
exactly how Opera 8.5 works. Both Firefox 1.5 and IE 6.0, however, print
the content of the navigation.
The only workaround I've found is to explicitly set display: none for the
tags contained within these sections:
a, span {
display: none;
}
Can someone tell me why this is so. I assume there is a better way of
doing this.
I've based all my StyleSheets on Eric's book "Eric Meyer on CSS".
Another question I have is: is there a good way of having dynamic elements
in CSS? I have some keyvisuals for my website which I would like to make
section specific.
div#picture {
background: #F0EFDD url(/images/image.jpg) no-repeat;
}
I would like to have something like "portrait.jpg" for pages about a
person, "flower.jpg" for pages about flowers, etc.
In addition to different stylesheets for each section, I can think of have
three solutions, which are for unsatisfactory for different reasons:
the first is to generate the stylesheet dynamically through a server side
process which will set the right image in the stylesheet. This allows the
browser to cache the image but as it usually caches the stylesheet the
images are only cleaned when a page is reloaded. In addition this muddies
the source of the stylesheet.
the second is to set the url of the image to a server side script. This
works best but as the image is a script, it can no longer be cached.
the third is to use Javascript to alter the stylesheet on the client side.
Apart from not working when Javascript is disabled this has the
disadvantage that the names and paths of the images have to be part of the
Javascript source. While a server side script could provide this
information for Javascript I think this complicates things unnecessarily
by requiring client and server side scripts.
Suggestions very much appreciated.
Charlie Clark
______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
IE7b2 testing hub -- http://css-discuss.incutio.com/?page=IE7
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/