Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSS

css device orientation

/* For portrait, we want the tool bar on top */

@media screen and (orientation: portrait) {
  #toolbar {
    width: 100%;
  }
}

/* For landscape, we want the tool bar stick on the left */

@media screen and (orientation: landscape) {
  #toolbar {
    position: fixed;
    width: 2.65em;
    height: 100%;
  }

  p {
    margin-left: 2em;
  }

  li + li {
    margin-top: .5em;
  }
}
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #css #device #orientation
ADD COMMENT
Topic
Name
1+6 =