Log in

View Full Version : Mobile website using CSS



lowmarklow
09-29-2010, 09:12 AM
Hi Guys,

Just wondering if anyone knows about mobile versions of a website?

How do you get the page to recognise it's being viewed on a mobile and to pull out a CSS style sheet instead of the usual one it uses?

Thanks!

Mark

jscheuer1
09-29-2010, 02:14 PM
For the full explanation of all that's allowed, see:

http://www.w3.org/TR/CSS2/media.html

Basically (though there are other ways) you specify the media in the stylesheet link, example:


<link rel="stylesheet" href="mobile.css" media="handheld" type="text/css">