device-width
Deprecated
Avoid using this feature in new projects. Device media queries do not reflect available layout, only the physical size of the device. This feature may be a candidate for removal from web standards or browsers.>
Consider using the following features instead: Media queries.>
メモ:
ビューポートの幅を問い合わせる場合は、代わりに width メディア特性を使用してください。
構文
device-width 特性は、 <length> 値として指定します。これは範囲の特性であり、つまり接頭辞の付いた min-device-width および max-device-width の変化形を使用して、それぞれ最小値と最大値をクエリーすることができます。
例
>800 ピクセルより狭い機器に特別のスタイルシートを適用
html
<link
rel="stylesheet"
media="screen and (max-device-width: 799px)"
href="https://cdn.example.com/narrow-styles.css" />
仕様書
| 仕様書 |
|---|
| Media Queries Level 4> # device-width> |