I have a web page, I want to detect whether it’s running on mobile safari on an ipad. If so, it should load different css files (and if it is running on websheet then it should load another css).
I am using following way for handling css but it shows only one for both:
<link rel="stylesheet" href="main.css?v=2">
<link rel="stylesheet" media="handheld" href="css/handheld.css?v=2">
Are you using a programming language to dynamically generate pages? If so, you can use user-agent sent by browser and according to it, decide which css to include.
Example:
This will cause the css to load at the end of the file.