Great Tip, Thanks!
One way which i use, is to have a second class called ādontprintā, then in my print.css:
.dontprint { display:none; }
So in all my divs which i want to hide, have a second class.
e.g.
div class=ālogo dontprintā/div
Completely unrelated, but I gotta askā¦ did you self-author your Google widget, or did someone else make it for you, or did you use the submission tool for URLs?
Very nice, though I donāt think Iāll be browsing CodingHorror on my phone. Thereās a lot of data to download for the front page thatās just taken up by past stories Iām not interested in.
Jeff, have you considered excluding comments from print?
Second the post about Opera. So, letās see, you could download a free browser to test this out on mobile devices, or you could do the Microsoft way:
If youāre wondering what your website looks like on a mobile device, wonder no longer. Try it yourself and see. The Windows SmartPhone / PocketPC emulator was surprisingly easy to get up and running. Hereās what youāll need:
* A clean Windows XP SP2 virtual machine
* The latest version of ActiveSync.
* Standalone Device Emulator with Windows Mobile OS Images (download both items listed here)
* Virtual Machine Network Driver for Microsoft Device Emulator
Once youāve downloaded it all, install it in this order:
- Install ActiveSync
- Unzip and install V1Emulator (standalone_emulator_V1.exe)
- Install the Virtual Network Driver (netsvwrap.msi)
- Install the Emulator Images for Windows Mobile 5.0 (efp.msi)
Yeah. Thatās easier. Try looking out your window once in a while.
have you considered excluding comments from print?
I have, but sometimes the discussion in the comments adds significantly to the entry.
I figure if you want the main article only, you can limit the printout to the first 1 or 2 pages.
letās see, you could download a free browser to test this out on mobile devices, or you could do the Microsoft way
Sure, use whatever you want. I personally feel that the best way to test is actually on a mobile device (of whatever kind), and the cheapest way to do that is through an emulator.
You could use something like:
.blogbody {page-break-after: always;}
That way comments would always start on a new page.
Nathan, great tip! I implemented that on the print stylesheet, and it works a treat.
Ok. thx for nice tutorā¦
Thanks for the tip - will try it out NOW
thanks for the tip! just finished setting up mine ā¦ itās not perfect ā¦ but it does the job
Thanks again
I wouldnāt expect great results from the mobile stylesheet. Many phones, even though they support CSS, wonāt import an external CSS file (Iām looking at you, Nokia).
I tend to prefer a single style sheet over a few (as with separate print stlye sheets). A minimal style sheet for printing can then be achieved even easier [1].
[1] http://meiert.com/en/blog/20070221/print-style-sheets-the-basics-for-no-excuses/
Thank you very much for the code! Iāve had the code for creating a printer specific CSS and I absolutely love it (I really like being able to make a page that looks great both on the screen and when printed in hard copy). I had no idea the very same code could be used (with a few modifications) to create a page for mobile phones. Iāve never really thought about formatting any of my pages for mobile phones before, but it makes sense. With all of the new phones out there adding more and more web functions and with the internet packages becoming cheaper, more people will be using their phones to surf the net. If you have FireFox, they have some very nice add on packages that let you very quickly and easily change the page to display a site like it would appear on a mobile phone. I downloaded one just for fun, and youād be amazed at how many sites donāt load on phones.
Thanks for this great post, Iāll use it!
Perfect! Today I had to do a printer friendly version of several pages. Luckily I came upon this article. I always wondered how this was done. Adding to my toolbox. Nice stuff!
Thanks!!
Wow, how sad is it that Iām a web developer and didnāt know about this. This is going to save me a lot of time over the next few months!
Great, guy!
Congrats!
Iāve recently taken the alternate style sheet switcher from A List Apart, at http://www.alistapart.com/articles/alternate/ and modified it to be used with the media attribute instead of the title attribute. Iām working on a website, and at the moment I have 3 links on the page, one to switch to each set of stylesheets. No page reload, no PHP detection of which stylesheet to pass, just a tiny bit of javascript to switch between different media sets. My main purpose for now is debugging without actually constantly opening up a Mobile emulator or Print Preview, but I also plan on using it to create a printer-friendly link, for users who assume that what they see is whatās actually going to be printed.