Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2

Thread: Accelerometers

  1. #1
    New Coder
    Join Date
    Jan 2008
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Accelerometers

    Quick question, what methods do you use to ensure your design looks good when viewed on a mobile/tablet where the orientation and thus resolution can change after the page is loaded?

    I guess this also applies to desktops and windows being resized but on desktops there is generally a min-width and horizontal scrollbars.

    Thanks

  • #2
    Regular Coder
    Join Date
    Jul 2011
    Location
    India
    Posts
    496
    Thanks
    3
    Thanked 57 Times in 56 Posts
    Please let me know if following code example is answer for your question:

    Code:
    h1 { 	display: table-cell; 	vertical-align: middle; 	text-align: center; } 	h1 span { display: none; }   /* Portrait */ @media screen and (max-width: 320px) { 	h1 span:nth-child(1) { display: inline; } }   /* Landscape */ @media screen and (min-width: 321px) { 	h1 span:nth-child(2) { display: inline; } }


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •