Results 1 to 3 of 3

Thread: Viewport dimensions

  1. #1
    New Member
    Join Date
    Feb 2012
    Posts
    2

    Smile Viewport dimensions

    I was having trouble writing specific styles for Motorola Droid 2 Global in portrait view and iPod Touch in landscape view, because they each seemed to read the same CSS file even though the viewport dimensions seemed different. So, I ran a jQuery script to get the exact viewport for each device, and it turns out that the Motorola Droid 2 Global in portrait view is 480px (width) and the iPod Touch in landscape view is also 480px (width)! How can this be? The width of the iPod Touch in landscape seems larger than the Droid in portrait view. What can I do to make each device read it's own CSS stylesheet in their respective views? I don't want them to share the same stylesheet.

  2. #2
    Senior Member ChinaMobi's Avatar
    Join Date
    May 2010
    Posts
    1,593

    Default

    Hello jjfossey, welcome.

    While I have not tried, I understand you can use device detection (Andy Moore on this forum has written a program for this purpose, as I recall.) to select CSS to use.

    For all my sites, I just let the viewport scale to the width of any device being used.

    <meta name='viewport' content='user-scalable=no, width=device-width' />

  3. #3
    New Member
    Join Date
    Feb 2012
    Posts
    2

    Smile Thanks

    Thanks for the tip! I greatly appreciate it.

    Quote Originally Posted by ChinaMobi View Post
    Hello jjfossey, welcome.

    While I have not tried, I understand you can use device detection (Andy Moore on this forum has written a program for this purpose, as I recall.) to select CSS to use.

    For all my sites, I just let the viewport scale to the width of any device being used.

    <meta name='viewport' content='user-scalable=no, width=device-width' />

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
A Yup.mobi Mobile Site
Mobile Dating