Comments
litl_phil wrote: While it's nice that Google and Acer share the vision of cloud-based computing, it's also worth noting that we at litl already have a webbook on the market (available at litl.com) that runs our own cloud-based OS. Unlike Chrome, litlOS is focused on creating a new and better web experience for the home, so we don't have the usual browser interface, we have our own innovative UI. In conjunction with easel mode (litl's inverted-V position) and our growing cohort of litl channels (special apps t...
Cloud Expo on Google News


2008 West
DIAMOND SPONSOR:
Data Direct
SOA, WOA and Cloud Computing: The New Frontier for Data Services
PLATINUM SPONSORS:
Red Hat
The Opening of Virtualization
GOLD SPONSORS:
Appsense
User Environment Management – The Third Layer of the Desktop
Cordys
Cloud Computing for Business Agility
EMC
CMIS: A Multi-Vendor Proposal for a Service-Based Content Management Interoperability Standard
Freedom OSS
Practical SOA” Max Yankelevich
Intel
Architecting an Enterprise Service Router (ESR) – A Cost-Effective Way to Scale SOA Across the Enterprise
Sensedia
Return on Assests: Bringing Visibility to your SOA Strategy
Symantec
Managing Hybrid Endpoint Environments
VMWare
Game-Changing Technology for Enterprise Clouds and Applications
Click For 2008 West
Event Webcasts

2008 West
PLATINUM SPONSORS:
Appcelerator
Get ‘Rich’ Quick: Rapid Prototyping for RIA with ZERO Server Code
Keynote Systems
Designing for and Managing Performance in the New Frontier of Rich Internet Applications
GOLD SPONSORS:
ICEsoft
How Can AJAX Improve Homeland Security?
Isomorphic
Beyond Widgets: What a RIA Platform Should Offer
Oracle
REAs: Rich Enterprise Applications
Click For 2008 Event Webcasts
SYS-CON.TV
Top Links You Must Click On


Media Types and Their Uses in CSS 2
There are presently 10 recognized media types in CSS

These days, not all users will be viewing your web site on a computer screen. Using Media types can open up a whole host of opportunities for restyling your content to cater to a variety of different devices. Media types can also open up a couple of cans of worms if you're still supporting archaic browsers, but we'll talk about that in a bit.

If you've begun to use Cascading Style Sheets for styling your screen documents, you've seen how powerful CSS really is. You may have even ventured into the realm of creating a print style sheet to facilitate a user's ability to print your web pages. If so, you already know that you had to specify the target medium (print) using the media attribute on the element. Or maybe you just copied something a friend told you to use and you really have no idea what you did. Likely the element in the head of your document looked something like this:

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

Tip: If you have not yet created a print style sheet, see Adrian Senior and Stephanie Sullivan's article in Macromedia's DevNet Center for a behind-the-scenes look at the creation of the Community MX print style sheet (www.macromedia.com/devnet/mx/dreamweaver/articles/screen_to_print.html)'

Recognized Media Types
There are presently 10 recognized media types in CSS 2; all, aural, braille, embossed, handheld, print, projection, screen, tty, and tv. CSS 2.1, which is now a Candidate W3C Recommendation, switches speech for aural in this list. These media types allow you to indicate to specific user devices, different methods of styling and presenting your content. As the list of possible devices grows, it is likely that more will be added. The names chosen for these media types are not case sensitive and should be fairly self-explanatory, but in case they're confusing, Table 1 is the list according to the W3C site:

Due to the variety of unique characteristics each media has, each media type may have certain properties that are unique to it. Some examples are:

  • page-break-before - applies only to paged media
  • pause-before - applies only to spoken media
These unique properties allow you more control within each media itself.

Media Type Tips to Keep in Mind
First, it is imperative to know which browsers and devices you are supporting. Take a look at your client's current browser statistics, or request detailed information regarding their desired browser and device support. This information determines the method you choose to specify your media-dependent style sheets.

Browser support for some of the media types can be tough. Netscape 4 doesn't support anything but screen, and even that may be buggy. Luckily though, the other media types won't choke it. IE4 can read all, screen, and print, so if that browser must be supported, you can't use the same tricks you use for NN4. Personally, I'm doing less and less for those old gals. I want them to receive the same information in a neat logical order, but outside that, unless a client's stats show me otherwise, the styling they see will be minimal.

My main goal for legacy browsers is to make sure they don't choke on the web pages. For more on CSS support in old browsers, RichInStyle.com has a CSS support chart (www.richinstyle.com/bugs/table.html) with information on browser support for the screen, all and print media types, among other CSS properties. The chart doesn't include any version-6+ browsers, but is good for keeping track of elderly browser support.

All
According to the CSS2 recommendation, if a media type is not specified, it should default to the all media type. Most browsers follow this guidance. The all media type can be used for properties that are available to all media devices. This sheet will start the CSS cascade, and from there, the specific devices, if in compliance, will continue by parsing their specific style sheet. You should note however, that older versions of Opera used media screen as their default display.

Screen
Screen is the most commonly used media type. At this time, the majority of assistive technology products available read the screen style sheets instead of aural ones. I hope that they'll catch up sooner rather than later. Remember though, that style sheets given the screen media type will not be used for any of the other devices, including printers.

Handheld
If you're creating a CSS document for handheld media, remember that you're creating not only for a small screen, but likely also a monochromatic one, with very little bandwidth or memory available. Sometimes the connection may be less than optimal as well. Be sure to use the {display:none} property to remove any extraneous page information to keep the display simple. Give them, "just the facts!" Here are some tips from the AcIS Handheld Report:

  • Use very few, low-resolution, or low color depth images
  • Use alt text for all images
  • Keep individual pages short
  • Use very little text formatting
  • Keep page formatting flexible to fit many screen shapes and sizes
For more tips, see Optimizing Web Pages for Handheld Devices at the Palm Power web site (www.palmpower.com/issuesprint/issue199902/avantgotips.html). Also be aware that Opera currently supports several media types including handheld.

Projection
This one is pretty nifty in my opinion. I first saw it in action at the fifth TODCON web conference event a couple years ago during Eric Meyer's presentation and later used it in my own. Opera still uses this media type to the best advantage. You can create a presentation for viewing either full screen or on an overhead projector.

This page on OperaShow (www.opera.com/support/tutorials/operashow/index.dml) gives you full instructions, but in a nutshell, you create your presentation as one long HTML document and then create the page breaks. This could even be used for an existing web site where the screen display looks completely different from the one needed or wanted for the projection device. There are some interesting styling possibilities that are available with this method. For example, you can place a watermark-type background image that will appear on each projected page. Simply set the image positioning value to fixed image in the body element in your CSS document. Or, you can give an interesting bordered heading style to the <h1> element that will be at the top of each page. In action, this one looks like magic - or even PowerPoint!

About Stephanie Sullivan
Stephanie Sullivan is a Web developer, partner at CommunityMX (www.communitymx.com), owner of VioletSky Design (www.violetsky.net), and contributing author of Dreamweaver MX 2004 Magic.

In order to post a comment you need to be registered and logged in.

Register | Sign-in

Reader Feedback: Page 1 of 1

Media Types and Their Uses in CSS. These days, not all users will be viewing your web site on a computer screen. Using Media types can open up a whole host of opportunities for restyling your content to cater to a variety of different devices. Media types can also open up a couple of cans of worms if you're still supporting archaic browsers, but we'll talk about that in a bit.


Your Feedback
MXDJ News Desk wrote: Media Types and Their Uses in CSS. These days, not all users will be viewing your web site on a computer screen. Using Media types can open up a whole host of opportunities for restyling your content to cater to a variety of different devices. Media types can also open up a couple of cans of worms if you're still supporting archaic browsers, but we'll talk about that in a bit.
Enterprise Open Source Magazine Latest Stories . . .
Oracle seems to have divided the open source ranks over the MySQL delay it’s having closing its acquisition of Sun. Eben Moglin, the GPL’s most ardent defender and delineator, the lawyer who has worked hand in glove for years with the Free Software Foundation’s founder Richard Stallman...
Cloud computing is a game changer. The cloud is disrupting traditional software and hardware business models by disrupting how IT service gets delivered. Entrepreneurial opportunities abound as this classic disruptive technology begins to proliferate, so it is no surprise that SYS-CON'...
The irony is that Oracle has advanced MySQL, lost money in the process, and helped its competitors - all at the same time. When Oracle buys Sun and controls MySQL the gift (other than to Microsoft SQL Server) keeps on giving as the existential threat to RDBs is managed by Redwood Shore...
WSO2, the open source SOA company, today announced the launch of the WSO2 Cloud Platform. Available today, the new WSO2 Cloud Platform features a family of WSO2 Cloud Virtual Machines; WSO2 Cloud Connectors for enabling fast, secure cloud services; and the multi-tenant WSO2 Governance-...
Now, the open source Mozilla Thunderbird client software can be used with Open-Xchange collaboration software. The "Community OXtender for Thunderbird" software connector gives users full access to appointments and contacts stored in the Open-Xchange Server and enables them to use Thun...
Morph Labs, a leading provider of enterprise cloud computing technology, today announced an introductory trial of the Morph CloudServer, an open, standards-based server IT organizations can use to rapidly model and evaluate their cloud implementations. A miniature "Cloud Environment in...
Subscribe to the World's Most Powerful Newsletters
Subscribe to Our Rss Feeds & Get Your SYS-CON News Live!
Click to Add our RSS Feeds to the Service of Your Choice:
Google Reader or Homepage Add to My Yahoo! Subscribe with Bloglines Subscribe in NewsGator Online
myFeedster Add to My AOL Subscribe in Rojo Add 'Hugg' to Newsburst from CNET News.com Kinja Digest View Additional SYS-CON Feeds
Publish Your Article! Please send it to editorial(at)sys-con.com!

Advertise on this site! Contact advertising(at)sys-con.com! 201 802-3021


SYS-CON Featured Whitepapers
ADS BY GOOGLE