?
This document uses PHP Chinese website manual Release
device-height:<length>
<length>:
用長(zhǎng)度值來定義高度。不允許負(fù)值
本特性接受min和max前綴,因此可以派生出min-device-height和max-device-height兩個(gè)媒體特性。
簡(jiǎn)單列舉幾個(gè)應(yīng)用示例:
@media screen and (device-height:800px){ … } @import url(example.css) screen and (min-device-height:800px); <link media="screen and (min-device-height:300px) and (max-device-height:900px)" rel="stylesheet" href="example.css" />
Values | IE | Firefox | Chrome | Safari | Opera | iOS Safari | Android Browser | Android Chrome |
---|---|---|---|---|---|---|---|---|
Basic Support | 6.0-8.0 | 2.0-3.0 | 4.0-25.0#1 | 6.0#1 | 15.0+ | 6.0-6.1#1 | 2.1-4.3#1 | 18.0-24.0#1 |
9.0-11.0#1 | 3.5+ | 26.0+ | 6.1+ | 7.0+ | 4.4+ | 25.0+ |
不支持嵌套媒體查詢。
<!DOCTYPE html> <html lang="zh-cmn-Hans"> <head> <meta charset="utf-8" /> <title>media features device-height_CSS參考手冊(cè)_web前端開發(fā)參考手冊(cè)系列</title> <meta name="author" content="Joy Du(飄零霧雨), dooyoe@gmail.com, www.doyoe.com" /> <style> @media screen and (min-device-height:800px){ body{color:#f00;} } </style> </head> <body> <div class="test">當(dāng)你的輸出設(shè)備分辨率高度設(shè)置為800px時(shí),本行文字顯示為紅色</div> </body> </html>
點(diǎn)擊 "運(yùn)行實(shí)例" 按鈕查看在線實(shí)例