![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Right now I have separate style sheets for screen and print, but of course there's a lot of duplication between them. I'd like to consolidate them into one style sheet for all media, with specific @media rules for the stuff that is different for print. 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: ???????? } } |
#3
| |||
| |||
|
|
Right now I have separate style sheets for screen and print, but of course there's a lot of duplication between them. I'd like to consolidate them into one style sheet for all media, with specific @media rules for the stuff that is different for print. 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: ???????? } } |
#4
| |||
| |||
|
|
Right now I have separate style sheets for screen and print, but of course there's a lot of duplication between them. I'd like to consolidate them into one style sheet for all media, with specific @media rules for the stuff that is different for print. 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. |
#5
| |||
| |||
|
|
Right now I have separate style sheets for screen and print, but of course there's a lot of duplication between them. I'd like to consolidate them into one style sheet for all media, with specific @media rules for the stuff that is different for print. 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. |
| @media print { |
#6
| |||
| |||
|
|
Why don't you look at the CSS spec. |
#7
| |||
| |||
|
|
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 */} } |
#8
| |||
| |||
|
|
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;} |
|
Here's what I do: #content {width:80%;} @media print { #header, #nav, #footer {display:none} #content {width:100%;} } |
#9
| |||
| |||
|
|
Stan Brown wrote: Do it the other way round. @media screen { .onlyprint { display: none }} *@media print { .onlyprint { /* dont say anything */} |
#10
| |||
| |||
|
|
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? |
![]() |
| Thread Tools | |
| Display Modes | |
| |