Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 12-15-2012, 04:36 PM   PM User | #1
jscolton
New to the CF scene

 
Join Date: Dec 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
jscolton is an unknown quantity at this point
device-width and 320px and HTC Evo

Hi,

I am trying to design a mobile app to have a width of 320px (height no so important - happy for it to vary).

I have read various articles including:
http://sunpig.com/martin/archives/20...el-ratios.html


...and noticed that setting the 'viewport' attribute with 'width=device-width' causes iphones and samsung phones to have a width of 320px.

I initially thought that this setting causes the browser to take the devices real width and divides it by the phone's pixel ratio, eg:
iphone3: pixel ratio:1, device-width: 320px so 320/1 = 320px.
iphone4: pixel ratio:2, device-width:640px so 640/2 = 320px
samsung 1: pixel ratio:1.5, device-width:480px so 480/1.5 = 320px.

But, HTV evo kills this theory as follows: pixel ratio:1.5, device-width:480px so 480/1.5 = 320px BUT in reality is has a reported width of 360px!

I was wondering if the author of your related article:

http://www.javascriptkit.com/dhtmltu...queries2.shtml

...or anyone else could explain to me why the HTC Evo gives this unexpected width when using 'width=device-width'?

Many thanks
Jeremy
jscolton is offline   Reply With Quote
Reply

Bookmarks

Tags
320, 360, device-width htc evo

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:52 AM.


Advertisement
Log in to turn off these ads.