OK Nog thanks a billion for the user agent tip. I am now looking into the layout of the page, trying to get some CSS that adjusts depending on the phone orientation. I'm really hoping to avoid using javascript. So far I think I'm getting close but really want this to look good.
I've provided some screenshots on an iPod touch (320x480 screen) and have a few issues:
I wish the image would be larger and/or centered on bigger screens (like my Nexus S)
Note in the landscape screenshot that the address font appears largish -- almost as large as the company name -- and that the font spills off the screen. Also I want the image to snuggle more cozily to the left to leave more room for the text.
* If the textual information is taller than the image, i don't really want the text wrapping around the image. Image left, text right is the desired layout.
I'm trying to strike a balance between using percentage widths for auto-scaling and pixel widths to prevent the image from consuming the entire tiny iPod Touch screen. The goal is:
In portrait, have image top and address bottom
In landscape have image left and address right
Here's the HTML code:
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>Example Tag Page</title>
<style>
body {
width:100%;
padding:0px;
margin:0px;
font-family: "Trebuchet MS", sans-serif;
}
p {
margin: 2px 0px;
}
#customer_image_div {
width:100%;
height:50%;
max-width:320px;
max-height:320px;
margin:none;
text-align:center;
/* background-color:red; */
float:left;
}
#customer_image {
max-width:98%;
max-height:200px;
}
#customer_info {
font-size:12px;
margin:5px;
}
#customer_url {
color:#7E0000
}
#customer_name {
font-size:20px;
font-weight:bold;
}
</style>
</head>
<body>
<div id="customer_image_div"><img id="customer_image" src="images/boomcycle_sample_image.jpg"></div>
<div id="customer_info">
<p id="customer_name">Extraordinary Lengthy Company Name</p>
<p id="customer_address">1234 Main Street<br>
Los Angeles, CA 90025</p>
<p id="customer_phone">(818) 555-1234</p>
<p id="customer_url">www.companyname.com</p>
</div>
</body>
</html>