![]() | |
![]() |
| | Thread Tools | Display Modes |
#11
| |||
| |||
|
|
Tue, 21 Jul 2009 09:22:30 GMT from rf <rf@z.invalid>: Stan Brown wrote: One thing has me stumped, though: certain elements should be visible only on print. So the style sheet specifies class .onlyprint as display:none. But then how do I override that for print media? I don't want to list a rule for each element to set them to inline, block, and so on. Do it the other way round. @media screen { .onlyprint { display: none } } @media print { .onlyprint { /* dont say anything */} } That would work if the only two media were print and screen. But the spec lists about a dozen, and even worse it says that there may be others. So how do I say "display:none" for every medium except print? |
|
There must be a way, but I'm not finding it in the spec. |
#12
| |||
| |||
|
|
One thing has me stumped, though: certain elements should be visible only on print. * |
#13
| |||
| |||
|
|
Tue, 21 Jul 2009 00:15:44 -0400 from C A Upsdell cupsdell (AT) nospam (DOT) not>: Why don't you look at the CSS spec. Thank you. I did -- which is why I posted my question. |
#14
| |||
| |||
|
|
On 21 July, 03:09, Stan Brown <the_stan_br... (AT) fastmail (DOT) fm> wrote: One thing has me stumped, though: certain elements should be visible only on print. display: inherit; but (of course) it doesn't (didn't?) work under IE, so you have to do it "longhand" and instead expand for each HTML element type and use either block or inline accordingly. |
#15
| |||
| |||
|
|
Tue, 21 Jul 2009 02:43:25 +0000 (UTC) from Adrienne Boswell arbpen (AT) yahoo (DOT) com>: Gazing into my crystal ball I observed Stan Brown the_stan_brown (AT) fastmail (DOT) fm> writing in news:MPG.24ceed528d4d8ddc98bb75 @news.individual.net: One thing has me stumped, though: certain elements should be visible only on print. So the style sheet specifies class .onlyprint as display:none. But then how do I override that for print media? I don't want to list a rule for each element to set them to inline, block, and so on. .onlyprint { display: none } @media print { .onlyprint { display: ???????? } } Perhaps .onlyprint {display:block;} Thanks, Adrienne. But what happens when I do a <span.onlyprint>? I don't want to turn inline elements into block elements. |
|
Here's what I do: #content {width:80%;} @media print { #header, #nav, #footer {display:none} #content {width:100%;} } Right, I understand that. My problem is when I want diskpal:none on all media *except* print. There are too many in the spec to list, and the spec itself says that there may be other media types. |
|
Or should I just not worry about anything but screen and print and maybe projection? |
#16
| |||
| |||
|
|
On Jul 21, 5:22*am, "rf" <r...@z.invalid> wrote: Stan Brown wrote: Do it the other way round. @media screen { .onlyprint { display: none }} *@media print { .onlyprint { /* dont say anything */} Why does one have to define .onlyprint for print media? If it is only defined for screen then the class will be ignored for print. Am I missing something? |
#17
| |||
| |||
|
|
On 21 July, 03:09, Stan Brown <the_stan_br... (AT) fastmail (DOT) fm> wrote: One thing has me stumped, though: certain elements should be visible only on print. * display: inherit; but (of course) it doesn't (didn't?) work under IE, so you have to do it "longhand" and instead expand for each HTML element type and use either block or inline accordingly. |
#18
| |||
| |||
|
|
Tue, 21 Jul 2009 04:45:28 -0700 (PDT) from Helpful person rrllff (AT) yahoo (DOT) com>: On Jul 21, 5:22 am, "rf" <r...@z.invalid> wrote: Stan Brown wrote: Do it the other way round. @media screen { .onlyprint { display: none }} @media print { .onlyprint { /* dont say anything */} Why does one have to define .onlyprint for print media? If it is only defined for screen then the class will be ignored for print. Am I missing something? But my problem is, screen and print are not the only media. I could list braille, embossed, and the rest (all but print), but the spec specifically says there can be others. If I ignore all media but screen and print, then it's easy: as you say, define .onlyprint for screen and don't define it for print. But I was hoping for a more comprehensive solution. How about |
#19
| |||
| |||
|
|
Tue, 21 Jul 2009 07:52:46 -0700 (PDT) from Andy Dingley dingbat (AT) codesmiths (DOT) com>: On 21 July, 03:09, Stan Brown <the_stan_br... (AT) fastmail (DOT) fm> wrote: One thing has me stumped, though: certain elements should be visible only on print. * display: inherit; but (of course) it doesn't (didn't?) work under IE, so you have to do it "longhand" and instead expand for each HTML element type and use either block or inline accordingly. Yes, I feared that was the case. No disrespect intended, but I hate it! It's ugly and verbose, and goes against what I'm trying to do which is to achieve an overall reduction in the amount of CSS that has to be fetched. |
#20
| |||
| |||
|
|
Did you have a look at my earlier post? Have a look at [http://www.cavalcade-of-coding.info/usenet/testprint.html] and see if that helps. |
![]() |
| Thread Tools | |
| Display Modes | |
| |