几个典型的应用方式
@media (min-height:400px){ … }
@media screen and (height:600px){ … }
@import url(example.css) screen and (height:800px);
应用例子
!doctype html>
<html>
<head>
<title>Test media query of height</title>
<style>
@media all and (min-height:200px) and (max-height:250px){
body{
background-color:green;
}
}
</style>
</head>
<body>
<h1>This is a test</h1>
</body>
</html>
- 当页面的高度在200px至250px之间的时候,页面的颜色为绿色