Device orientation


/ Published in: CSS
Save to your folder(s)

These are just two css media queries you may want to use for your website development. With lots of smart-phones, and tablets being able to orientate their screens from landscape to portrait, you may want to include different styles for each. This is how you would go about achieving this.


Copy this code and paste it in your HTML
  1. @media all and (orientation:portrait) {
  2. /* Style adjustments for portrait mode goes here */
  3. }
  4.  
  5. @media all and (orientation:landscape) {
  6. /* Style adjustments for landscape mode goes here */
  7. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.