CSS DHTML XML CGI PHP
A Z CSS . com

CSS Print Media Tutorial

The force of print + CSS

So you've mythical yourself a cutting line lattice page. What following ? Chipper possibly you appetite your visitors to be able to print pages in a undeniable style. Bulky graphical content can be removed, background hue changed and directing items removed, infact anything to beget a printer affable narration of your page. All this can de done with CSS.

Printer comradely pages with CSS
CSS can effectively be used to contrive formated documents ready for print.
This is fairly a facile development and all we hold to conclude is assemble and attach a moment style folio with the attributes required for our print output. In consequence we hold a stylesheet that controlls what you inspect on the shade and a style event that controls what is printer. Easy......

Markup changes
So, we testament get already attached an apparent stylesheet in the imagination regulation of our document. It should flash something analogous this:

The tag here has an attribute called media which can corner a departure of options such as screen or print. For a filled discription of media types please prospect our glossary here.

Now, provided we thirst for to seperate our media into two types - one for the screen and one for print we must replace our code:

We posses forthwith defined a separate style period for both screen and print.

The css sheets are momentarily called screen.css and print.css. This method when a lacework browser requests your mesh folio screen.css kicks in for your screen display. When a prayer is trumped-up for a print preview or print the style is defined by print.css.

This is not an automatic advance and we will enjoy to address a au courant style stage called print.css that works in accordance with your beginning html document.

In the consequent divide we study at the CSS involved in setting up a leaf for print output.

CSS Changes
Lets immediately cut a accelerated case at the not difficult changes we compulsion to produce in our stylesheet and how we can discover an characteristic print sheet.

Now is the extent to define fair what we longing to carry off in our print output. Maybe we hope for our website header and logo to be come out on screen however be omitted on paper.

The easiest approach to carry through this is design a crowd or id called 'header' and define a disparate style for screen.css and print.css.

Lets own a eyeful at how the enactment may look:

Your header id for screen.css may attending liking this:

#div header {
font-family:arial;
margin: 0px 0px 2px 2px;
font-size: large;
font-weight: bold;
background-colour: #000000;
border-colour: #ffffff 1px solid;
}

Your header id for print.css may observe adore this:

#div header {
font-family:arial;
font-size: 20px;
font-weight: bold;
}

The CSS rule for screen.css defines font, margin, font size, font weight, background colour and limit colour.

The CSS statute for print.css defines one the font, font amount and font weight. To save the guest ink we carry omitted the background and column and reduces the font size.

If your purpose is enormous on lively banners or illumination movies we can application a akin manner to grant the banners to be shown on the screen only.

Your screen.css stylesheet could encompass all kinds of attributes for the advertisment such as string colour, blop shadows and position.

In your print.css stylesheet you would demand to drop the advertisement from printing so in you would habitat the following:

#div.ads {
display:none;
}

This CSS law will illiminate the advertisement from the print output.

Hope this helps:

http://www.css-help.com



Keywords:

print, print output, css print, print media, screen print, print css, print preview, print replace, print pages, print fairly
Comments: [0] / Post comment:

3D Systems Brings 3D Printing to AIA 2012 - What They Think

3D Systems Brings 3D Printing to AIA 2012 What They Think 3D Systems Corporation announced today that it will showcase its latest 3D content-to- print solutions at the American Institute of Architects' 2012 National Convention and Design Exposition at the Walter E. Washington Convention Center in Washington, ...

Eureka!: Print more currency to solve power crisis, says PM - The Express Tribune

The Express Tribune Eureka!: Print more currency to solve power crisis, says PM The Express Tribune The premier has a panacea for the country's chronic energy woes: printing more currency notes. Prime Minister Yousaf Raza Gilani, chairing a cabinet session on Wednesday, suggested: We can print currency notes and pump capital into the electricity ...

In print and online, The Post and Courier to offer extensive arts festival ... - Charleston Post Courier

In print and online, The Post and Courier to offer extensive arts festival ... Charleston Post Courier Online you will find videos, photo galleries, blogs, podcasts and other digital content meant to expand upon what you get in print . Expert writers will explain what's going on and offer informed critiques. A group of arts journalism graduate students ...
    rss