stylesheets and mobile browsers
I aint sure if I have asked this question in other threads as well ... but my question have still been unanswered ... what I need to know is that while using Opera mini... or browsing site on the mobile.. are there certain restrictions while using HTML or CSS ?? I got totally confused with certain terms like Screen Stylesheets and Handheld Stylesheets... while getting the medi开发者_StackOverflow中文版a type, there was a mention that we gotta use some screen or handheld stylesheets .... depending upon the media type ... just not sure how else to ask ....
Stylesheets for media=handheld
were supposed to be used by mobile browsers, but once browsers became more advanced, browser vendors started ignoring media=handheld
, because they can display media=screen
now (browser chooses what media it supports).
A more modern and much more flexible approach is to use CSS3 Media Queries that let you set certain styles only when selected criteria match, e.g. minimum screen size. Keep in mind though that mobile browsers report virtual (zoomed out) screen size in width
media queries, and device-width
is closer to physical size.
Mobile browsers may have restrictions on some HTML or CSS rules, just like each browser vendor has it's specifities on this subject. You'll have to check what works or not for the mobile browsers you are developing.
The media types (screen, handheld, etc) is defined by CSS, so you can use different stylesheets to different kinds of media. So, you can display the same content differently to each kind of media. Notice that the types screen, handheld, etc, doesn't define window sizes, only different types of devices. Check the links below, to get a better understanding of it:
http://www.w3.org/TR/CSS2/media.html
http://www.alistapart.com/articles/return-of-the-mobile-stylesheet
Hope it helps!
精彩评论