Posted By

johnloy on 10/07/09


Tagged

css textmate mobile CSS3 iphone


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

umang_nine


css media queries for determining iphone orientation


 / Published in: Other
 

  1. h1 {
  2. display: table-cell;
  3. vertical-align: middle;
  4. text-align: center;
  5. }
  6. h1 span { display: none; }
  7.  
  8. /* Portrait */
  9. @media screen and (max-width: 320px)
  10. {
  11. h1 span:nth-child(1) { display: inline; }
  12. }
  13.  
  14. /* Landscape */
  15. @media screen and (min-width: 321px)
  16. {
  17. h1 span:nth-child(2) { display: inline; }
  18. }

Report this snippet  

You need to login to post a comment.