This is an archive of an inactive wiki and cannot be modified.

Using Media type handheld

This technique gives a possible implementation for the CategoryCss using @media rules.

Pre-requisites:

Implementation Steps:

Code sample 1

A mobile browser will apply the rules in the @media statement. A full screen browser will ignore those, but download the lined stylesheet. For other media types such as TV or print no style rules are defined.

<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>Media Handheld</title>
<style type="text/css">
@media handheld {
 * {margin: .2em .5em} /* a silly rule */ 
}
</style>
<link href="my.css" media="screen" rel="stylesheet" />
</head><body>
<ol>
<li>Some thing</li>
<li>Else</li>
<li>Another one</li>
</ol>
</body></html>

Back to BestPracticesList



CategoryCss CategoryXhtml

Contributions to this wiki are governed by the W3C policies for Contribution to W3C' wiki on Mobile Web.