| You are here: | About>Computing & Technology>Web Design / HTML> About.com Web Design A to Z> Web Design Articles A-H> Web Design/HTML Articles C> CSS2 Media Types Create Print-Friendly Pages |
![]() | Web Design / HTML |
Web Design PathOther CSS ResourcesCSS Media Types Create Print-Friendly PagesDon't Create Multiple Pages or Fiddle with ScriptsYou've decided to make your site "printer-friendly". You read the article on what it means to be printer friendly, but now you have to decide how you want to do it. There are several options:
The drawback to option one should be fairly obvious to most people. It is very labor intensive and requires that for every page on your site, you create a second, duplicate page. Option two is the most common choice right now, because it mitigates the problems of option one, and with a small change in how you write your Web pages, you can set it up for every page on your site. But if you don't have access to CGI or you just don't feel comfortable with programming, this method can be challenging, if not impossible. Cascading Style Sheets to the RescueLuckily, CSS was not written with just Web pages in mind, and with just a few extra codes you can create a printer style sheet that removes all the non-friendly options on your page and even takes into account issues such as typography and readability. And you don't have to write two different copies of your page or do any programming to build it. Defining a Style Sheet for PrintAs with screen style sheets, you use the <link> element to define the print style
sheet your Web page should use: The only difference between this link element and the link to your screen style sheet is
the attribute: Building the Style SheetWhen you build a print-friendly style sheet, you need to keep in mind all the rules that were defined in the previous article:
Change these rules into CSS: Underline links: Remove Non-Essential Images, Ads, Navigation, and Scripting
Define each of them with a <div> element:
Then, in your style sheet, get rid of the ads, navigation, and other information: The print.css Style SheetThe print.css style sheet would look like this: Save print.css in the same directory as the file, include the <link rel="stylesheet" type="text/css" href="print.css" media="print" /> in the head of your document, and your page will print perfectly while displaying however you would like. Web Design PathOther CSS Resources |
Las Vegas on a BudgetFind a BargainHotel DealsCheap EatsFree AttractionsEntertainment for Less |
All Topics | Email Article | | | ![]() |
| Advertising Info | News & Events | Work at About | SiteMap | Reprints | Help | Our Story | Be a Guide |
| User Agreement | Ethics Policy | Patent Info. | Privacy Policy | ©2008 About, Inc., A part of The New York Times Company. All rights reserved. |


