aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/css/@media/any-hover/index.html
diff options
context:
space:
mode:
authorPeter Bengtsson <mail@peterbe.com>2020-12-08 14:40:17 -0500
committerPeter Bengtsson <mail@peterbe.com>2020-12-08 14:40:17 -0500
commit33058f2b292b3a581333bdfb21b8f671898c5060 (patch)
tree51c3e392513ec574331b2d3f85c394445ea803c6 /files/zh-cn/web/css/@media/any-hover/index.html
parent8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff)
downloadtranslated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz
translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2
translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip
initial commit
Diffstat (limited to 'files/zh-cn/web/css/@media/any-hover/index.html')
-rw-r--r--files/zh-cn/web/css/@media/any-hover/index.html76
1 files changed, 76 insertions, 0 deletions
diff --git a/files/zh-cn/web/css/@media/any-hover/index.html b/files/zh-cn/web/css/@media/any-hover/index.html
new file mode 100644
index 0000000000..195b19371b
--- /dev/null
+++ b/files/zh-cn/web/css/@media/any-hover/index.html
@@ -0,0 +1,76 @@
+---
+title: any-hover
+slug: Web/CSS/@media/any-hover
+tags:
+ - '@media'
+ - CSS
+ - Reference
+ - 媒体查询
+ - 媒体特性
+translation_of: Web/CSS/@media/any-hover
+---
+<div>{{cssref}}</div>
+
+<p><strong><code>any-hover</code></strong> <a href="/en-US/docs/CSS">CSS</a> <a href="/en-US/docs/Web/CSS/Media_Queries/Using_media_queries#Media_features">媒体特性</a> 可以用来测试是否有<em>任意</em>可用的输入机制可以在元素上 hover。</p>
+
+<h2 id="语法">语法</h2>
+
+<p><code>any-hover</code> 使用下面列表的值作为关键字。</p>
+
+<dl>
+ <dt><code>none</code></dt>
+ <dd>可用的输入机制里没有机制可以方便地 hover,或者不存在定点输入机制。</dd>
+ <dt><code>hover</code></dt>
+ <dd>一个或多个可用的输入机制可以方便地在元素上 hover。</dd>
+</dl>
+
+<h2 id="示例">示例</h2>
+
+<h3 id="测试是否有输入机制可以_hover">测试是否有输入机制可以 hover</h3>
+
+<h4 id="HTML">HTML</h4>
+
+<pre class="brush: html notranslate">&lt;a href="#"&gt;Try hovering over me!&lt;/a&gt;</pre>
+
+<h4 id="CSS">CSS</h4>
+
+<pre class="brush: css notranslate">@media (any-hover: hover) {
+ a:hover {
+ background: yellow;
+ }
+}</pre>
+
+<h4 id="结果">结果</h4>
+
+<p>{{EmbedLiveSample("Testing_whether_input_methods_can_hover")}}</p>
+
+<h2 id="规范">规范</h2>
+
+<table class="standard-table">
+ <thead>
+ <tr>
+ <th scope="col">规范</th>
+ <th scope="col">状态</th>
+ <th scope="col">备注</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>{{SpecName('CSS4 Media Queries', '#descdef-media-any-hover', 'any-hover')}}</td>
+ <td>{{Spec2('CSS4 Media Queries')}}</td>
+ <td>Initial definition.</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="浏览器兼容性">浏览器兼容性</h2>
+
+
+
+<p>{{Compat("css.at-rules.media.any-hover")}}</p>
+
+<h2 id="更多资料">更多资料</h2>
+
+<ul>
+ <li><a href="/en-US/docs/Web/CSS/@media/hover">the <code>hover</code> media feature</a></li>
+</ul>