How to set up a webpage for the iphone :: How to
In case anyone is interested in setting up a web page for the iphone, this is the template I used for all my pages. You can add more code if you like but this is how I have been generally setting up my pages.
How to:
1) Create a new document and save it as index.html.
2) Copy and paste this code into your document.
3) Start developing between the <body> tags.
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN”
“http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml” xml:lang=”en” lang=”en”>
<head>
<meta name=”viewport” content=”width=device-width; initial-scale=1.0; maximum-scale=1.0;”>
<link rel=”apple-touch-icon” href=”images/myiphone_ico.png”/>
<link href=”../styles/iphone_portrait.css” rel=”stylesheet” type=”text/css” media=”screen” id=”orient_css”>
<link href=”../styles/styles.css” rel=”stylesheet” type=”text/css” media=”screen”/>
<script type=”text/javascript” src=”js/script.js”> </script>
<script type=”text/javascript”>
<!– Orientation Script
function orient(){
switch(window.orientation){
case 0: document.getElementById(“orient_css”).href = “../styles/iphone_portrait.css”;
break;
case -90: document.getElementById(“orient_css”).href = “../styles/iphone_landscape.css”;
break;
case 90: document.getElementById(“orient_css”).href = “../styles/iphone_landscape.css”;
break;
}
}
window.onload = orient();
–>
</script>
<title></title>
</head>
<body onorientationchange=”orient();”>
</body>
</html>
