Click here to Skip to main content
15,913,610 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am developing mobile application using Asp.net 2010. I want to use external CSS file in mobile application. i know how to use mobile Stylesheet but i dn`t want to use StyleSheets.
Posted
Updated 21-Aug-13 20:30pm
v2

1 solution

If you don't want to use Mobile StyleSheets, then link css files defining media="handheld" like below... More about media Attribute[^].
HTML
<link rel="stylesheet" href="css/handheld.css" type="text/css" media="handheld" />


Refer - Designing a Mobile Stylesheet for your Website[^].
Quote:

The Power of CSS


Lucky for us CSS is a powerful language applicable to many areas of styling websites. It’s a simple job to structure styles compatible with mobile devices only, along with a slew of options for how pages are structured.


Below is some simple code you can add to your site to allow for an external CSS stylesheet. Notice the media type set to “handheld” which is the definitive factor for parsing mobile styles.


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

This stylesheet attachment will only load when your site is parsed by a mobile browser. This is an invaluable technique that doesn’t take long to implement and will catch the largest majority of your visitors.


It used to require some fancy JavaScript data management to determine what type of browser your visitors were running and display CSS styles accordingly. As our standards grow it makes the developers job that much simpler. You can rename your .css file to anything you’d like, the only key aspect of the above link element is the media attribute.


 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900