All the articles, all the subjects!
Articles  Articles  Articles

Css Print Media Tutorial


Overall rating: (N/A)

The article "CSS Print Media Tutorial" talks about css, it was created by Karl Regis.

The power of prnit + CSS So you've made yourself a cutting edge web page.
What next ?



Well maybe you want your visitors to be able to print pages in a certain style. Haevy graphical content can be removed, background colour changed and navigation items removed, infact anything to make a printer friendly version of your page.

All this can de done with CSS. Printer friendly pages with CSS CSS can effectively be used to create formated documents ready for print. This is qutie a simple process and all we have to do is create and attach a second style sheet with the attributes required for our print output. Therefore we have a stylesheet that controlls what you see on the screen and a sytle sheet that controls what is printer. Easy...... Markup changes So, we will have already attached an external stylesheet in the head code of our documnet.

It should look something like this: The tag here has an attribute called media which can have a variety of options such as screen or print.

For a full description of media tyeps please view our glossary here.

Now, if we want to separate our media into two types - one for the screen and one for prnit we must alter our code: We have at this moment defined a separate style sheet for both screen and print. The css sheets are at this moment called screen.Css and print.Css.

This means when a web browser requests your web page screen.Css kicks in for your screen display. When a request is made for a print preview or print the style is defined by print.Css. This is not an automatic process and we will have to write a new style sheet claled print.Css that works in accordance with your original html document. In the next section we look at the CSS involved in setting up a page for pirnt output.

CSS Changes Lets at this moment take a close look at the simple changes we need to make in our stylesheet and how we can create an individual print sheet. Now is the time to define exactly what we want to achieve in our print output.
Maybe we want our website header and logo to be appear on screen but be omitted on paper. The easiest way to achieve this is create a class or id called 'header' and define a different style for screen.Css and print.Css. Lets have a look at how the code may look: Your header id for screen.Css may look like 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 haeder id for print.Css may look like this: #div header { font-family:arial; font-size: 20px; font-weight: bold; } The CSS code for screen.Css defines font, margin, font size, font weight, background colour and border colour. The CSS code for print.Css defines only the font, font size and font weight. To save the visitor ink we have omtited the background and border and reduces the font size. If your web site is heavy on animated banners or flash movies we can apply a similar technique to allow the banners to be shown on the screen only. Typical markup for you advertisment movies could be like this:




Write a comment
Write a comment about the article
CSS Print Media Tutorial



Top Articles Searches
Music Business Lessons From The Village People Ezine Advertising Works: Top 10 Reasons To Advertise With Ezines Increasing Site Traffic Luxury Baby Bedding - What To Look For Before You Buy Archery Fishing Tips and Techniques One Of Cancun's Best What do customers really want? Used Car Buying - 5 Steps To Success After the shot, Trailing Deer Part 1 Woodworking Beginners: Secret Tips To Start Right An Introduction to Glow Sticks Determining Your Online Ad Budget America - Is it in Bible prophecies and what can the USA expect at the second coming of Jesus Christ Specialty Advertising in C-Stores Red Bull and Vodka--What a Pair! Payment Plan Options for Home Treadmills Enjoy Your Vacations with Colorado Ski Vacation Package Buying A Computer: Processor & Memory: Affordability And Performance Buying Tips Most Profitable Adsense Money Making Tip Nokia 7380 Mobile Phone Deals – Exceptional Features at Inimitable Costs


Link To Us! Add to favorites Tell a friend! RSS Feed

Sitemap   Privacy Policy   Terms Of Service