This is the old MovableType blog. To enter the new blog visit the home page.
September 17, 2003E-commerce > Printer StylesheetsI'm still tweaking the blog after switching from Blogger Pro to Movable Type. The latest tweak is to my print stylesheet. My main page has a list of links on the right-hand side. Anyone printing that page probably doesn't want those links, so I decided to make the sidebar non-printing. This is a quick explanation of how to suppress printing for part of a page. Most blogging software includes a template with a default stylesheet, either as part of the document header, or as a separate document. Part of the flexibility of Cascading Style Sheets (CSS) is that you can define different stylesheets for different output devices: screen, printer, audio reader, etc. The first step is to include a line in the document header pointing web browsing software to the print stylesheet (the trailing slash is to make that line XHTML compliant; omit it if you're still validating to HTML 4.01 or earlier): <link rel="stylesheet" media="print" href="/print.css" /> Next, enclose the area you don't want to print in a div tag for a new class called "noprint": <div class="noprint">stuff you don't want to print</div> Finally, create a file called print.css on the web server and define a noprint class: .noprint { display : none; } That's all you need to designate part of a page non-printing. Because my new page design has light text on a black ground it could drain an ink cartridge in a hurry. To keep that from happening, I reversed the color scheme for the print.css file (the * matches all elements and classes): * { color:black; background:white; } That makes the text print correctly, but I still have some background areas that print in black. Know how to fix it? Post in comments. Posted by lesjonesComments
I'm guessing, but you could try { color:white; background:white; text:black} Good post, BTW. Posted by: Mike Spenis at March 09, 2004Have you seen this before? It's a number guessing game: http://www.amblesideprimary.com/ambleweb/mentalmaths/guessthenumber.html. I guessed 28836, and it got it right! Pretty neat. Posted by: Merideth Carleton at January 20, 2006Comments on the old blog are closed. |
Search
Sponsors
Archives
Every post A&E - (205) Best Of - (54) Blogging - (252) Comic Books - (30) Dancing Baloney - (26) Dear Lazyweb - (17) E-commerce - (159) East Tennessee - (283) Economics - (93) Environment - (71) European Union - (38) Everything's Illegal - (5) Family Tree - Moore Side - (6) Food & Drink - (77) Funny Ha-Ha - (164) Guns - (390) Health Care - (43) Home Life - (263) John Kerry - (1) Johnia Berry - (48) Macular Degeneration - (11) Media Behaving Badly - (56) Middle East - (47) Misc - (105) Mortgage Crisis - (3) Municipal Wi-Fi - (17) News - (304) Nifty - (97) Photos - (34) Political Survival Kit - (16) Politics - (60) Polls - (19) Population - (31) PSAs - (11) Quotes - (195) Rocky Top Brigade - (38) Science - (126) Scratch Pad - (5) Seventies - (3) Social Security - (9) Star Wars - (54) Tech - (111) The Usual Suspects - (15) Timothy Treadwell - (6) Travel - (60) True Crime - (69) Word of the Day - (98) |