I just added printing capability to a web site using a style sheet (ie. @media print, etc.) and was wondering if I could use a similar method for adding support for mobile devices.
If not, how do I detect a mobile device? My pages are C# (.aspx) and I'd like to scale back the pages for ease of use on a mobile device.
Any advice for me?
EDIT: My wife has a BlackBerry, so at a miminum I'd like to enable our company's web site for that.
Most of the web designers never think of using mobile apps for their web designing work. Do you know that you can actually perform web designing using your Android device? There are several web designing apps for android that can make your web designing process easier.
I'm not sure how the IPhone/iPod Touch declare themselves when requesting the stylesheet, but for most, using
<style type="text/css">
@media handheld
{
/* handheld styles */
}
</style>
should do the trick. It works in the same way @media print does (or doesn't).
For a complete list of media types, see here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With