Some Questions Regarding Print Style Sheets . . . (Full Version)

All Forums >> [Web Development] >> Cascading Style Sheets



Message


Nicole -> Some Questions Regarding Print Style Sheets . . . (9/11/2007 7:34:21)

I notice Carrie has resurrected a Print Style Sheet Thread from just over a year ago, coincidently on the day when I have some more questions that I don't know the answers to - but remembering that I can't totally control how a print version of a website will print as different users will have different settings.

A website I've been working on for a while is nearing completion, the Print Style Sheet is usually the last thing I look at as I just copy the main CSS file and rename it and then set about adding {display: none;} to elements, changing background colours to #fff and text in most cases to #000 and so on.

I've read a bit lately about saving paper and printer ink, and although I may not implement anything that I'm thinking into this website, most of the examples of my questions are contained within it. So here goes:

1. I have several Frequently Asked Questions pages, typically they list the questions at the top and the headings and answers follow as per this page.

I feel it's quite unnecessary to have the list of questions appear at the top of a printed page, especially as there are only about 2 or 3 printed pages. Typing {display: none;} into the Print Style Sheet does get rid of them, but it also leaves a gap where those questions would've been. Ideally I'd also like to remove the "back to top" links also, a gap there won't matter, but I can't live with that gap of missing questions so I've just left them there.

Is the only solution to this to place the list of questions inside a unique <div> and then tell that <div> to {display: none} in the Print Style Sheet?

2. The other question I have is in relation to a table on the site here

I figure somebody could quite well want to print the list of events out and say stick on their fridge. But they don't need the two end columns which are purely for website users only and will be available at the end of an event. Is there a way to tell a Print Style Sheet to not print some table columns, or is that getting too pedantic?




Donkey -> RE: Some Questions Regarding Print Style Sheets . . . (9/11/2007 8:14:40)

You could try giving the two end columns a different class then use display none.




Tailslide -> RE: Some Questions Regarding Print Style Sheets . . . (9/11/2007 8:30:32)

Those questions should really be in a list - so then just give the list an id and do display:none for the id - voila! No list!




Nicole -> RE: Some Questions Regarding Print Style Sheets . . . (9/11/2007 17:51:03)

Ahhh yes - Lists. Definition Lists at that! Thanks!

Thanks also Donkey - I hadn't thought of that although I'll have to be careful as I'm not sure that that table class isn't used on other pages.





Tailslide -> RE: Some Questions Regarding Print Style Sheets . . . (9/12/2007 2:55:02)

Yes you could change it around and use a definition list with the question in the dt and the answer in the dd - TJK designs does a nice show/hide script for that. That way with the print stylesheet you just show the whole thing - no repetition to have to hide.

Or you can just leave the layout as it is but put all the questions in a normal list.




Donkey -> RE: Some Questions Regarding Print Style Sheets . . . (9/12/2007 9:39:23)

quote:

I'm not sure that that table class isn't used on other pages.
Give the body of the page it's used on a class, just add it with a comma to the body.

eg

body.wizzo,
body
{
whatever you already have
}

Then give that class to the body on pages where you want to hide the last two columns.

Then in your print style sheet

body.wizzo td.ultimatecol,
body.wizzo td.penultimatecol
{display: none;}




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.078125