What Are Media Types
October 30, 2000
One of the most exciting things about writing XHTML is that whatever you
write can be viewed anywhere in the world, regardless of the type of
computer being used to view the content. This means that whatever content
you write, you had better be prepared for it to be viewed on any number of
computers, television set-top boxes, game consoles, handheld digital
assistants, and mobile phones.
This would be quite a chore had HTML continued its evolutionary path of
including presentational elements like <b> for bold and
<center> for alignment. Fortunately, as we saw earlier in the book,
the World Wide Web Consortium were aware of this and invented Cascading
Style Sheets to separate presentation (how the web page looks) from content
(the stuff in the web page). This means that you can now have different
styles of presentations for different devices, without affecting the
content of your web page.
Each of these devices is categorized as belonging to a certain media type.
Media types include things like 'screen', for computer monitors, 'print'
for printed paper, and 'aural' for speech synthesizers.
Known Media Types and Media Type Descriptors
So far, we have used two media types: screen and print. The Cascading
Style Sheets Level 2 specification identifies a handful of other media
types and qualifies this list as not being considered definitive. With the
explosions of Internet appliances, there are certain to be an increasing
number of new media types.
Media Type Descriptor | Description |
| all | The style is suitable for all devices. |
| aural | The style is intended for speech synthesizers. In CSS-2, there are a handful of properties related to aural style sheets. |
| braille | The style is intended for braille tactile feedback devices. |
| embossed | The style is intended for paginated braille printers. |
| handheld | The style is intended for handheld devices. |
| print | The style is intended for paginated media (like the printed page) or when representing the printed page on a screen (such as a print preview mode). |
| projection | The style is intended for projectors and printing to film slides and transparencies. |
| screen | The style is intended for color computer screens. |
| tty | The style is intended for devices using a fixed-pitch character grid, such as teletypes. |
| ty | The style is intended for television-type devices. |
As shown in the table above, Cascading Style Sheets Level 2 has ten media
types that represent target devices for XHTML content. The names of these
media types are called 'media type descriptors'. The media type descriptors
are used as values for several case-sensitive attributes described below
and must be in lower case.
Style Sheet Properties Appropriate to a Media Type
Not every style sheet property is appropriate for every target device. The
volume property, for example, refers to what's known as the median volume
of a waveform. This property is clearly related to aural media types (i.e.
sound) and not to visually-oriented media types.
In fact, it turns out that there are relationships between the different
media types. These relationships are called media groups, and the World
Wide Web Consortium identifies four of these media groups:
- Continuous or paginated media
- Visual, aural, or tactile media
- Grid or bitmap media
- Interactive or static media
Each media type is a member of one or more of these media groups. For
example, the screen media type is a member of the continuous, visual,
bitmap, interactive, and static media groups.
Continuous or paginated media refers to the surface on which content is
rendered. If the surface can always extend to hold all of the content, the
media is considered continuous. If the surface has a limited size and
additional surfaces must be created to hold all of the content, the media
is said to be paginated. Computer screens are continuous and printed pages
are paginated. We will talk about paginated media later in this chapter.
Visual, aural, or tactile media refers to how the information is presented
to the user:
- If the user must use their eyes to consume the content, then the media is said to be visual.
- If the user must use their ears to consume the content, then the media is said to be aural.
- If the user must use touch to consume the content, then the media is said to be tactile.
Computer screens are visual, aural browsers are aural, and Braille printers
are tactile.
Grid or bitmap media refers to how the visual or tactile information is
rendered. If the information is rendered in a predefined grid layout (every
'character' has the same amount of space), then the media is said to be
grid-based. If the information is rendered pixel by pixel (every
'character' uses whatever space it needs), then the media is said to be
bitmap-based. Teletypes are grid-based and computer screens are bitmap-
based.
Interactive or static media refers to whether the user can interact with
the content. As would be expected, when the user can interact with the
content, the media is said to be interactive. When the user cannot interact
with the content, the media is said to be static. Computer screens are said
to be interactive and printed pages are said to be static.
The table below summarizes the relationships between media types and media
groups.
| Media Types | Media Groups |
| Continuous or Paginated | Visual, Aural, orTactile | Grid or Bitmap | Interactive or Static |
| aural | continuous | aural | neither | both |
| braille | continuous | tactile | grid | both |
| embossed | paginated | tactile | grid | both |
| handheld | both | visual | both | both |
| print | paginated | visual | bitmap | static |
| projection | paginated | visual | bitmap | static |
| screen | continuous | visual | bitmap | both |
| tty | continuous | visual | grid | both |
| ty | both | visual, aural | bitmap | both |
Each Cascading Style Sheet property is only valid for one or more media
groups. When you are tailoring a presentation to a particular media type,
you need to identify the appropriate media group and determine whether you
can control the desired property for that media group.
Beginning XHTML
Beginning XHTML
Associating Style Sheets with Media Types
|