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.


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="">
<head><title>Media Handheld</title>
<style type="text/css">
@media handheld {
 * {margin: .2em .5em} /* a silly rule */ 
<link href="my.css" media="screen" rel="stylesheet" />
<li>Some thing</li>
<li>Another one</li>

Back to BestPracticesList

CategoryCss CategoryXhtml

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