CSS media type: How to load CSS for mobile?

Andrea Ambu picture Andrea Ambu · Aug 8, 2009 · Viewed 56.8k times · Source

With this code:

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

on my N78 the nokia's default browser and opera mini load screen.css instead of mobile.css.
What am I missing?

Answer

dalizard picture dalizard · Aug 8, 2009

Nokia N78 uses the S60 browser, which reads only "screen" stylesheets. It won't read the "handheld". It doesn't support media query. Instead of trying to type everything here, have a look at this article and you will solve the problem - http://www.alistapart.com/articles/return-of-the-mobile-stylesheet