My native iPhone app displays HTML files using UIWebView. These HTML files are stored locally on the iPhone (they ship with the app).
Now I'm also trying to use a central CSS file in the HTML files, using something like:
<link href="../../stylesheet.css" rel="stylesheet" type="text/css">
In Safari, this works, the HTML files look OK.
In Mobile Safari (both on the simulator and a real device) this does not work: no CSS file found.
So I tried the following:
Store the CSS file in the same directory as the HTML file (plus different LINK of course): no problem.
Store the CSS file one directory higher: no problem, works in both Safari and mobile Safari.
Store the CSS file one directory higher: does not work in mobile Safari, but no problem in Safari.
What gives? In ../..
are various other directories that I created and use.
Note: ../..
points to a directory that is an immediate subdirectory of the bundle. ../..
does not try to go into the bundle directory.
Any ideas? Anyone who saw me demonstrate this was also baffled.