I was thinking of making a mobile optimized version of my website but I'm stuck on how the site can tell if it's a mobile device that's browsing, I assume it would be similar to the standard browser IF like:
Code:
<!--[if IE]>Things here.<![endif]-->
So i was just wondering what I would use to make it recognize a mobile browser and if there was a few codes for certain devices such as iPad and Android.
Last edited by Celestial; 06-22-2011 at 02:29 AM..
Reason: Resolved.
change www.example.com on Line 4 to your domain name. On the last line, change to your mobile website! Anytime someone views your site from a mobile device they will be forwarded to the domain name you specify on the last line!
__________________
"The problem with troubleshooting is that trouble shoots back."
change www.example.com on Line 4 to your domain name. On the last line, change to your mobile website! Anytime someone views your site from a mobile device they will be forwarded to the domain name you specify on the last line!
There appears to be a problem with this code, the site gets stuck on a loop of refreshes from it and I can't work out why. Any help?
there is special meta for ios devices. many of the same also work on android.
till, these are mostly for decorating shortcuts, except for the scaling markup; it's important to nail for a proper user experience. needless scrolling makes mobile suck.
use special css for mobile and sniff mobile stuff in js using tools like modernizer or ad-hoc detection.
scale back on image use; its cost user's money and slows down the page considerably.
you can clobber any existing background-image urls using more specific selectors to declare background:none; ...
emphasize features of the site that are likely to be used by someone on a small screen or in an on-the-go situation. for example if you're an organization, don't blather about your history on the landing page, throw a menu in my face, preferably something that offers simple single word options like [news, events, search, sections, about]...
bottom line: you don't have as much room to look pretty or do fancy stuff.
people don't want that. they want to get in and out as quickly as possible cause it a PITA using a mobile browser. the less painful you make it, they more they will love you.
__________________ my site (updated 5/13) STATS (2013/5) HTML5:90.2% MOB:14% IE7:0.5% IE8:8.6% IE9:9.8% IE10:10%