From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- files/ja/web/css/@media/resolution/index.html | 85 +++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 files/ja/web/css/@media/resolution/index.html (limited to 'files/ja/web/css/@media/resolution/index.html') diff --git a/files/ja/web/css/@media/resolution/index.html b/files/ja/web/css/@media/resolution/index.html new file mode 100644 index 0000000000..b71f0311f8 --- /dev/null +++ b/files/ja/web/css/@media/resolution/index.html @@ -0,0 +1,85 @@ +--- +title: resolution +slug: Web/CSS/@media/resolution +tags: + - '@media' + - CSS + - Media Queries + - Reference + - media feature + - メディアクエリ + - メディア特性 +translation_of: Web/CSS/@media/resolution +--- +
{{cssref}}
+ +

resolutionCSSメディア特性で、出力端末のピクセル解像度をテストするために使用することができます。

+ +

構文

+ +

resolution 特性は、出力端末のピクセル解像度を表す {{cssxref("<resolution>")}} 値として指定します。これは範囲の特性であり、つまり接頭辞の付いた min-resolution および max-resolution の変化形を使用して、それぞれ最小値と最大値をクエリすることができます。

+ +

+ +

HTML

+ +
<p>This is a test of your device's pixel density.</p>
+
+ +

CSS

+ +
/* 正確な解像度 */
+@media (resolution: 150dpi) {
+  p {
+    color: red;
+  }
+}
+
+/* 最小解像度 */
+@media (min-resolution: 72dpi) {
+  p {
+    text-decoration: underline;
+  }
+}
+
+/* 最大解像度 */
+@media (max-resolution: 300dpi) {
+  p {
+    background: yellow;
+  }
+}
+ +

結果

+ +

{{EmbedLiveSample("Example")}}

+ +

仕様書

+ + + + + + + + + + + + + + + + +
仕様書状態備考
{{SpecName('CSS3 Media Queries', '#resolution', 'resolution')}}{{Spec2('CSS3 Media Queries')}}初回定義
+ +

ブラウザーの互換性

+ + + +

{{Compat("css.at-rules.media.resolution")}}

+ +

関連情報

+ + -- cgit v1.2.3-54-g00ecf