Test out an iPhone-only stylesheet. The iPhone is special in that it doesn't take "handheld" stylesheets, so it must be customed. A PHP script is perfect to adjust the display of the stylesheet on the server's side so no JavaScript is involved.
Try this on different systems. Three statements are written, but only two are shown at any one time.
14 Nov 2008.
Trial and Error. The link tag didn't seem to work, so I used PHP to set it. Tested out on my sister's iPhone for I don't have one.
Here’s the code. Please link back here if you’re using it.
Put this PHP in the head tag.
if (stristr($_SERVER['HTTP_USER_AGENT'], "iPhone")) {
echo '<link media="only screen and (max-device-width: 480px)" href="iPhone01.css" type="text/css" rel="stylesheet" />';
} else {
echo '<link media="screen" href="screen01.css" type="text/css" rel="stylesheet" />';
}
Put this CSS in iPhone01.css
#screenOnly{
display:none;
}
Put this HTML in the body tag.
<div id='iPhoneOnly' >iPhone browsers only!</div>
<div id='all' >All browsers can read this.</div>
<div id='screenOnly' >Only screen browsers can read this.</div>