Using Media type handheld
This technique gives a possible implementation for the CategoryCss using @media rules.
Pre-requisites:
- a reasonable browser
Implementation Steps:
- Write a style sheet that uses @media rules to specify rules for particular kinds of device
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