aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/css/@media/hover/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'files/zh-cn/web/css/@media/hover/index.html')
-rw-r--r--files/zh-cn/web/css/@media/hover/index.html73
1 files changed, 73 insertions, 0 deletions
diff --git a/files/zh-cn/web/css/@media/hover/index.html b/files/zh-cn/web/css/@media/hover/index.html
new file mode 100644
index 0000000000..14c44ff8f7
--- /dev/null
+++ b/files/zh-cn/web/css/@media/hover/index.html
@@ -0,0 +1,73 @@
+---
+title: hover
+slug: Web/CSS/@media/hover
+tags:
+ - '@media'
+ - CSS
+ - Reference
+ - media feature
+translation_of: Web/CSS/@media/hover
+---
+<div>{{cssref}}</div>
+
+<p>该<strong><code>hover</code></strong> <a href="/en-US/docs/CSS">CSS</a> {{cssxref("@media")}} 可以根据用户的主要输入机制是否可以悬停在元素之上来应用样式。</p>
+
+<h2 id="语法">语法</h2>
+
+<p>悬停功能指定为从下面列表中选择的关键字值。</p>
+
+<dl>
+ <dt><code>none</code></dt>
+ <dd>主要输入机制无法悬停或不方便悬停(例如,当用户执行不方便的长按操作时,许多移动设备模拟悬停),或者没有主指示输入机制。</dd>
+ <dt><code>hover</code></dt>
+ <dd>主要输入机制可以方便地悬停在元素上。</dd>
+</dl>
+
+<h2 id="例子">例子</h2>
+
+<h3 id="HTML">HTML</h3>
+
+<pre class="brush: html">&lt;a href="#"&gt;Try hovering over me!&lt;/a&gt;</pre>
+
+<h3 id="CSS">CSS</h3>
+
+<pre class="brush: css">@media (hover: hover) {
+ a:hover {
+ background: yellow;
+ }
+}</pre>
+
+<h3 id="结果">结果</h3>
+
+<p>{{EmbedLiveSample("Example")}}</p>
+
+<h2 id="规范">规范</h2>
+
+<table class="standard-table">
+ <thead>
+ <tr>
+ <th scope="col">Specification</th>
+ <th scope="col">Status</th>
+ <th scope="col">Comment</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>{{SpecName('CSS4 Media Queries', '#hover', 'hover')}}</td>
+ <td>{{Spec2('CSS4 Media Queries')}}</td>
+ <td>Initial definition.</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="Browser_compatibility" name="Browser_compatibility">浏览器兼容性</h2>
+
+
+
+<p>{{Compat("css.at-rules.media.hover")}}</p>
+
+<h2 id="See_also">See also</h2>
+
+<ul>
+ <li><a href="/en-US/docs/Web/CSS/@media/any-hover">the <code>any-hover</code> media feature</a></li>
+</ul>