View Full Version : Accelerometers

07-31-2011, 08:31 PM
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.


07-31-2011, 09:26 PM
Please let me know if following code example is answer for your question:

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; } }