dimanche 8 mai 2011
CSS: @media (are you ready for the new mobile users generation?)
Do you like this story?
As said before, 2011 and 2012 will be the tablets years. Recently we have witnessed the wide spread of new generation devices increasingly used to surf the web. Because of that, web developers have been aware of possible restyling of old web sites needed to satisfy the new mobile users. It's really a matter of determining your audience. Is people visiting your site using mobile devices? Are you really interested in developing a new look for your site just to satisfy that portion of your audience?
That is quite an interesting point. I suspect that before jumping to conclusions, we need to analyse our audience, know who they are, what they want, what they expect from our web site, and how they want to browse the web site. Basically we need to know if we really need to make those changes to the structure of the site and if it's worth working on it, after all.
The syntax is as follow:
@media <media types>
{
/* media rules */
}
The <media types> can be:- all - for all devices
- braille - for braille devices
- embossed - for braille printers
- handheld - for handheld devices
- print - for documents viewed in print preview
- projection - for projected documents (using projectors)
- screen - for pc screens
- speech - for speech synthesizers
- tty - for fixed-pitch character grid devices (e.g. teletypes)
- tv - for televisions
As a side note, it is possible to set the media type directly in the link to the external stylesheet:
<link href="print.css" media="print" rel="stylesheet" type="text/css">
Anyway, the only media types that - almost - work with every browser are print and screen. That means troubles as usual.
For instance, Firefox implements only print and screen. But - as you may understand - Firefox is not really popular as handheld device browser.
There's a lot of debate around the fact that mobile browsers can handle @media rules. There are even discussion groups where people report their experience with different devices, with different browsers. And - let me say - it's all a bit confusing.
In the end, is it all worth it? Should we just register a new domain and develop a specific web site for mobile devices?
Let me know what you think about it.
This post was written by: Franklin Manuel
Franklin Manuel is a professional blogger, web designer and front end web developer. Follow him on Twitter
0 Responses to “CSS: @media (are you ready for the new mobile users generation?)”
Enregistrer un commentaire