Home / ASP.NET Wiki / CSS / User Friendly Print page

User Friendly Print page

 Rate It (8)

  • Tags:   
  • CSS

Introduction

The CSS media type “print” allows authors to specify a stylesheet that is only used when printing. This can be very useful and allows for neatly styled printouts that hide non-essential parts of the page and only contain the main content. It’s a great concept.

To achive this, create a separate stylesheet say, print.css, and put your classes there in the css file. Apply the classes to the fields you want to customise while printing and then add the following in your page's head section.

 <link rel="Stylesheet" href="../Style/print.css" media="print" type="text/css" />

Note: This will only apply when someone is printing the page.

Give it a try!!

Revision number 2, Sunday, September 04, 2011 4:50:08 PM by mbanavige

Comments

you can also used CSS in Div and print the DIV directly to printer.

Related Articles

AJAX and CSS

Cascading Style Sheets (CSS) is one of the core technologies in the AJAX architecture apart from XML, DOM, JSON and so forth. Here are some links on using CSS with AJAX: Create flickr-like editing fields using AJAX and CSS/ 26 best ways to implement ajax css

Great CSS Tutorials

Great CSS Tutorials When I started web development I was a great pain to manage styles using CSS. But later on as I explored the CSS, I found the power and flexibility of using CSS. Here I am listing some of CSS tutorials which will be usefull for every web

Adding CSS 3.0 support to Visual Studio 2010

Many of us want to use CSS 3.0. This feature is promised in Visual Studio 2010 however if you open any given CSS file, the option does not appear in the dropdown. So I decided to write this WIKI to help. 1. Open this link to download the CSS 3.0 installer

CSS Friendly Pages

From CodePlex: "The CSS Friendly Control Adapters kit (for ASP.Net 2.0) provides pre-built control adapters that you can easily use to generate CSS-friendly markup from some of the more commonly used ASP.NET controls. " Start by reading the original

Shortcuts

Table of Contents

Top Wiki Contributors

(last 30 days)

  1. abiruban (1)