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/pointer/index.html | 103 +++++++++++++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 files/ja/web/css/@media/pointer/index.html (limited to 'files/ja/web/css/@media/pointer') diff --git a/files/ja/web/css/@media/pointer/index.html b/files/ja/web/css/@media/pointer/index.html new file mode 100644 index 0000000000..c912376e81 --- /dev/null +++ b/files/ja/web/css/@media/pointer/index.html @@ -0,0 +1,103 @@ +--- +title: pointer +slug: Web/CSS/@media/pointer +tags: + - '@media' + - CSS + - メディアクエリ + - メディア特性 + - リファレンス +translation_of: Web/CSS/@media/pointer +--- +
{{cssref}}
+ +

CSSpointer メディア特性は、ユーザーが(マウスなどの)ポインティングデバイスを持っているか、もしそうならば、主要なポインティングデバイスにどれだけの正確性があるかを調べます。

+ +
+

メモ: すべてのポインティングデバイスの正確性を調べたい場合は、代わりに any-pointer を使用してください。

+
+ +

構文

+ +

pointer 特性は、以下の一覧の中から一つのキーワード値で指定します。

+ +
+
none
+
主要な入力メカニズムに、ポインティングデバイスがありません。
+
coarse
+
主要な入力メカニズムにポインティングデバイスがありますが、その正確性が限定されています。
+
fine
+
主要な入力メカニズムにポインティングデバイスがあり、正確性も高いです。
+
+ +

+ +

次の例は、主要なポインティングデバイスの正確性によって、チェックボックスの大きさを変更しています。正確性が高い場合は小さく、低い場合は大きくなります。

+ +

HTML

+ +
<input id="test" type="checkbox" />
+<label for="test">Look at me!</label>
+ +

CSS

+ +
input[type="checkbox"]:checked {
+  background: gray;
+}
+
+@media (pointer: fine) {
+  input[type="checkbox"] {
+    -moz-appearance: none;
+    -webkit-appearance: none;
+    appearance: none;
+    width: 15px;
+    height: 15px;
+    border: 1px solid blue;
+  }
+}
+
+@media (pointer: coarse) {
+  input[type="checkbox"] {
+    -moz-appearance: none;
+    -webkit-appearance: none;
+    appearance: none;
+    width: 30px;
+    height: 30px;
+    border: 2px solid red;
+  }
+}
+ +

結果

+ +

{{EmbedLiveSample("Example")}}

+ +

仕様書

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

ブラウザーの対応

+ + + +

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

+ +

関連情報

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