Snippets

iPhone CSS Detector

iPhone Detector is great as it allows you to style for the iPhone device and standard web browsers.
Simply add your iPhone stylesheet to the ‘iphone.css’ location and add your default stylesheet to the ‘default.css’
Good Luck & Enjoy.

<?php
  $browser = strpos($_SERVER['HTTP_USER_AGENT'],"iPhone");
  if ($browser == true){$browser = 'iphone';}
?>
			
<?php if($browser == 'iphone'){ ?>
  <link rel="stylesheet" href="css/iphone.css" />
<?php } else{ ?>
  <link rel="stylesheet" href="css/default.css" />
<?php } ?>

Source: http://www.media21a.co.uk/themes/infinite-tumblr-gallery/...

Share this snippet

 

Leave a Reply

Your email address will not be published. Required fields are marked *

Please respect the following rules: No advertising, no spam, no keyword in name field. Thank you!