![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
[...] I have one page at <http://www.douglaidlaw.net/boykett/1854_letter.html which contains a letter written by my ancestor. I have given the letter its own selector of "letter" but it is within the "Content" div. I would like [my] specific stylesheet to print the "letter" div only. If I hide the "content" div, I hide its contained divs, don't I? |
#3
| |||
| |||
|
|
I have a genealogy site at http://www.douglaidlaw.net/boykett/ I have written a generic print-friendly stylesheet following Simon Collison's "Beginning CSS". I have one page at 1854_letter.html which contains a letter written by my ancestor. I have given the letter its own selector of "letter" but it is within the "Content" div. I would like to create a specific stylesheet to print the "letter" div only. If I hide the "content" div, I hide its contained divs, don't I? |
|
Could I perhaps tag the "letter" div to make a page only rule, which would take precedence? This must have come up before. |
#4
| |||
| |||
|
|
Doug Laidlaw wrote: [...] I have one page at http://www.douglaidlaw.net/boykett/1854_letter.html> which contains a letter written by my ancestor. I have given the letter its own selector of "letter" but it is within the "Content" div. I would like [my] specific stylesheet to print the "letter" div only. If I hide the "content" div, I hide its contained divs, don't I? Yes. One thing you might try is using visibility:hidden; on your #content and #sidebar, and then visibility:visible; on #letter. This makes the bulk of #content invisible, although it all still takes up space, while the actual #letter contents will show up. Since the stuff in #letter will appear needlessly overly spaced, you can then try to compensate for the huge apparent margins with margin:-18em 0 -11em -11em; or similar. The large negative bottom margin should avoid having a lot of empty pages printed after the letter itself. My method still leaves a largish space to the left where the nav sidebar is not visible, but maybe you can solve that to your satisfaction yourself. |
#5
| |||
| |||
|
|
Doug Laidlaw wrote: I have a [page] at http://www.douglaidlaw.net/boykett/1854_letter.html ... Could I perhaps tag the "letter" div to make a page only rule, which would take precedence? This must have come up before. No, you can't. What you can do is hide everything else that should not be "printed", just as you have with the navigation and whatnot (as you should). Your case is quite easy, your content div has a buch of stuff before your letter, then the letter, then a bunch of other stuff after the letter. Put the "stuff" in an enclosing div and then put the "other stuff" in an enclosing div and hide those, leaving the "content" div visible. |
#6
| |||
| |||
|
|
I have a genealogy site at http://www.douglaidlaw.net/boykett/ I have written a generic print-friendly stylesheet following Simon Collison's "Beginning CSS". I have one page at 1854_letter.html which contains a letter written by my ancestor. I have given the letter its own selector of "letter" but it is within the "Content" div. I would like to create a specific stylesheet to print the "letter" div only. If I hide the "content" div, I hide its contained divs, don't I? Could I perhaps tag the "letter" div to make a page only rule, which would take precedence? This must have come up before. |
#7
| |||
| |||
|
|
John Hosking wrote: Doug Laidlaw wrote: [...] I have one page at http://www.douglaidlaw.net/boykett/1854_letter.html> which contains a letter written by my ancestor. I have given the letter its own selector of "letter" but it is within the "Content" div. I would like [my] specific stylesheet to print the "letter" div only. If I hide the "content" div, I hide its contained divs, don't I? Yes. One thing you might try is using visibility:hidden; on your #content and #sidebar, and then visibility:visible; on #letter. This makes the bulk of #content invisible, although it all still takes up space, while the actual #letter contents will show up. Since the stuff in #letter will appear needlessly overly spaced, you can then try to compensate for the huge apparent margins with margin:-18em 0 -11em -11em; or similar. The large negative bottom margin should avoid having a lot of empty pages printed after the letter itself. My method still leaves a largish space to the left where the nav sidebar is not visible, but maybe you can solve that to your satisfaction yourself. Er, what? |
![]() |
| Thread Tools | |
| Display Modes | |
| |