terry’s Weblog

weblog for terry’s finding

Web to-go?!

Mobile phone or handheld devise should play a important role in the concept of “always connect”. Especially the so call 3.5G HSDPA become more common on those mobile devise and also carrier’s network.

To help the web page easier access by mobile devise, it’s better serve different set of CSS for page rendering. It could help web page looks better for specific devise OS. There is a CSS property, media type, can provide some logic for developer serve different set of CSS base on the user agent.

Media type info at w3: http://www.w3.org/TR/REC-CSS2/media.html

e.g. The following code can let different user agent render the web page with different font size.

@media print {
BODY { font-size: 10pt }
}
@media screen {
BODY { font-size: 12pt }
}
@media screen, print {
BODY { line-height: 1.2 }
}

The “media type” application might not properly work in the real world. It caused by some devise agent will not follow the definition to declare itself. e.g. a cell phone browser declare itself as a “screen” instead of “handheld”.

Filed under: Finding

Leave a Reply