如何使用mediaquery

时间:2015-07-29 07:52:48

标签: css css3 media-queries

有没有办法在css中执行此操作? @media screen and (min-width < min-height)

我开始写一个前端库,我希望根据这个条件“响应”。

1 个答案:

答案 0 :(得分:9)

检查方向,例如http://codepen.io/anon/pen/LVXzvK

@media all and (orientation: landscape) {
  body:after {
     content: "width is greater than height"
  }
}

@media all and (orientation: portrait) {
  body:after {
     content: "height is greater than width"
  }
}