HighDots Forums  

Print stylesheet

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss Print stylesheet in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Doug Laidlaw
 
Posts: n/a

Default Print stylesheet - 03-22-2009 , 05:29 AM






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.

TIA,

Doug.
--
The complete truth is not the prerogative of the human judge.
- Judge Meir Shamgar.


Reply With Quote
  #2  
Old   
John Hosking
 
Posts: n/a

Default Re: Print stylesheet - 03-22-2009 , 07:54 AM






Doug Laidlaw wrote:
Quote:
[...]
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.

Above not comprehensively tested, just tried out a little bit in FF2.


Unrelated, but still on-topic for the group:
The (main, screen) CSS contains

body { font-size: 80%; }

Grrr. Whatsamatter? You don't *want* me to read your site?


Unrelated and OT: I note that you have a notice after the letter saying,

"Because it was not posted, the letter is technically still unpublished.
The release from copyright of documents more than 50 years old does not
apply to unpublished works. It is still copyright © the Estate of Thomas
Boykett."

Is this really true (IOW, does a qualified lawyer say this)? It's
further confusing since at the end of the letter, it also says, "When
this letter was published in the Adelaide Advertiser, ..."

Don't I hold copyright for original writings I make, even if they sit on
my desk for years? Just being a letter wouldn't make it copyrightable,
AFAIK, and *not* posting said letter wouldn't suffice to change the
copyright status. But then IANAL, which is probably the source of my
confusion on this. Also, I don't know Australian law, so maybe things
are upside-down there. ;-)


--
John
Possessive "its" has no apostrophe. Even on the Internet.


Reply With Quote
  #3  
Old   
rf
 
Posts: n/a

Default Re: Print stylesheet - 03-22-2009 , 08:01 AM



Doug Laidlaw wrote:
Quote:
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?
Yes, that is how it works.

Quote:
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.




Reply With Quote
  #4  
Old   
rf
 
Posts: n/a

Default Re: Print stylesheet - 03-22-2009 , 08:05 AM



John Hosking wrote:
Quote:
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?




Reply With Quote
  #5  
Old   
John Hosking
 
Posts: n/a

Default Re: Print stylesheet - 03-22-2009 , 01:26 PM



rf wrote:
Quote:
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.

Er, what?

It's not the #content div the OP wants visible. He said he wants to hide
#content, but print #letter, *which is enclosed in #content*. The stuff
fore and aft of #content are trivial to hide, but that not what he
wanted help with.

--
John
Still "quite easy"?


Reply With Quote
  #6  
Old   
BootNic
 
Posts: n/a

Default Re: Print stylesheet - 03-22-2009 , 02:42 PM



On Sun, 22 Mar 2009 20:29:25 +1100
Doug Laidlaw <doug (AT) dougshost (DOT) invalid> wrote in:
<l0dh96-gee.ln1 (AT) dougshost (DOT) douglaidlaw.net>

Quote:
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.
Providing the block of text after the h2 element is enclosed in a
element.

<p>Thomas Boykett wrote…</p>

#content #letter,
#content #letter *
{
display: block;
}

#masthead,
#sidebar,
#nav,
#content * {
display: none;
}

--
BootNic Sun Mar 22, 2009 02:42 pm
It is better to die on your feet than to live on your knees!
*Emiliano Zapata*

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)

iEYEARECAAYFAknGhpYACgkQylMUzZO6jeI8wwCgs4S59oGBVn unW7LBWLUEP7Tw
qGoAoL6U1ETj1iNwL2IGBzXMEvlwGp6J
=gaLz
-----END PGP SIGNATURE-----



Reply With Quote
  #7  
Old   
Doug Laidlaw
 
Posts: n/a

Default Re: Print stylesheet - 03-23-2009 , 12:03 AM



rf wrote:

Quote:
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?
Thanks to everybody who replied. And thanks BootNic for pouinting out
the missing <p> tag.

Doug.
--
A God who didn't create the universe is like the toughest kid on the block.
You can't depend on him or her. What if a tougher kid comes along?



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.