[WSG] Print media style sheet problems
Hi all I'm having problems with a print style sheet and wondered if anyone had any suggestions. Also, I would appreciate it if people on Windows machines would check out if the printing style sheet works okay. Apologies in advance - I'm not sure if my explanation of the problems makes much sense. I am redesigning a web site which you can see at http://www.brighton.ac.uk/adc-ltsn/new/html/home/home.html (launching early next month so excuse glitches and content) At home I am experimenting with a print style sheet so that, when a visitor prints, various bits and pieces don't appear on the printed version and a new title bar shows up. Here's the test page: http://homepage.mac.com/artistry/adc/html/home/home.html which has the print media style sheet attached. I am using Safari on Mac OS X 10.3.2. When I go to print, the stylesheet works perfectly, but... in the actual web page the Flash menu bar disappears! I am suspecting that this is because in the Print style sheet the div in which the Flash menu sits is hidden, but why is the browser applying this to the screen style sheet? In the brighton.ac.uk site this problem does not occur so it *must* be something to do with the print style sheet. Now onto the next problem. In Internet Explorer 5.2 and Netscape 7.1 on the Mac, the menu doesn't disappear in the browser and, correctly, doesn't print - but sections of the page which are marked as hidden are printed - check out the menus on the last page. They shouldn't be there! The print style sheet *is* being applied because the page header appears. In addition, in these two browsers, the text is printing as Times, which it shouldn't be. Why are some items visible when they shouldn't be? And why is font styling not working? Incidentally, if you want to see what the site looked like before I started redesigning, go to http://www.brighton.ac.uk/adc-ltsn Ignore the messy style sheets - there is a lot of rationalisation to be done! (I'm assuming having lots of redundant styles that need to be stripped out isn't causing the problems?) I've been doing this pretty much part time and teaching myself CSS along the way. Hope someone can decipher my problem and offer suggestions! Jonathan * The discussion list for http://webstandardsgroup.org/ *
Re: [WSG] Print Media
Taco Fleur wrote: With a print media style sheet is it like possible to say hide everything but this one ID? Example; I have a page with many elements, but I want to only print the form elements when printing. no you can't: http://www.w3.org/TR/REC-CSS2/visuren.html#display-prop the display property none This value causes an element to generate no boxes in the formatting structure (i.e., the element has no effect on layout). Descendant elements do not generate any boxes either; this behavior *cannot* be overridden by setting the 'display' property on the descendants. i don't know how this would look in real life use but i suggest violating the specs is bad. regards, Michael -- niij http://niij.org/ * The discussion list for http://webstandardsgroup.org/ *
Re: [WSG] Print Media
Taco, If you set the page up with content inside containers, you can do exactly as you suggest, and hide entire containers including all of their content. For example, rather than hide all the elements within a left nav, you could simple do: #leftnav { display: none;} If you page is housed in a series of containers, you could quickly hide entire sections with a few simple rules. Russ I understood that, but I was more after something where I did not have to specify every element, with a lot of elements it becomes a bit tedious to include all of them, it would be nicer to say, hide all only display ID X. I guess thats not possible then.. Taco Fleur Blog http://www.tacofleur.com/index/blog/ Methodology http://www.tacofleur.com/index/methodology/ 0421 851 786 Tell me and I will forget Show me and I will remember Teach me and I will learn -Original Message- From: russ weakley [mailto:[EMAIL PROTECTED] Sent: Tuesday, 20 January 2004 6:24 PM To: Web Standards Group Subject: Re: [WSG] Print Media Yep, just set all containers or elements that you don¹t need to display: none; on the print CSS only. You can take virtually everything off the page except the forms, if you want... Russ With a print media style sheet is it like possible to say hide everything but this one ID? Example; I have a page with many elements, but I want to only print the form elements when printing. Taco Fleur Blog http://www.tacofleur.com/index/blog/ http://www.tacofleur.com/index/blog/ Methodology http://www.tacofleur.com/index/methodology/ 0421 851 786 Tell me and I will forget Show me and I will remember Teach me and I will learn * The discussion list for http://webstandardsgroup.org/ *
RE: [WSG] Print Media
Off course, I see what your saying, stupid I did not understand the first time. Cheers Taco Fleur Blog http://www.tacofleur.com/index/blog/ Methodology http://www.tacofleur.com/index/methodology/ 0421 851 786 Tell me and I will forget Show me and I will remember Teach me and I will learn -Original Message- From: russ weakley [mailto:[EMAIL PROTECTED] Sent: Tuesday, 20 January 2004 7:09 PM To: Web Standards Group Subject: Re: [WSG] Print Media Taco, If you set the page up with content inside containers, you can do exactly as you suggest, and hide entire containers including all of their content. For example, rather than hide all the elements within a left nav, you could simple do: #leftnav { display: none;} If you page is housed in a series of containers, you could quickly hide entire sections with a few simple rules. Russ I understood that, but I was more after something where I did not have to specify every element, with a lot of elements it becomes a bit tedious to include all of them, it would be nicer to say, hide all only display ID X. I guess thats not possible then.. Taco Fleur Blog http://www.tacofleur.com/index/blog/ Methodology http://www.tacofleur.com/index/methodology/ 0421 851 786 Tell me and I will forget Show me and I will remember Teach me and I will learn -Original Message- From: russ weakley [mailto:[EMAIL PROTECTED] Sent: Tuesday, 20 January 2004 6:24 PM To: Web Standards Group Subject: Re: [WSG] Print Media Yep, just set all containers or elements that you don¹t need to display: none; on the print CSS only. You can take virtually everything off the page except the forms, if you want... Russ With a print media style sheet is it like possible to say hide everything but this one ID? Example; I have a page with many elements, but I want to only print the form elements when printing. Taco Fleur Blog http://www.tacofleur.com/index/blog/ http://www.tacofleur.com/index/blog/ Methodology http://www.tacofleur.com/index/methodology/ 0421 851 786 Tell me and I will forget Show me and I will remember Teach me and I will learn * The discussion list for http://webstandardsgroup.org/ * * The discussion list for http://webstandardsgroup.org/ *