aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/css/-webkit-touch-callout/index.html
blob: 0f0d3a218270ec025f66695252439466ce57149f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
---
title: '-webkit-touch-callout'
slug: Web/CSS/-webkit-touch-callout
translation_of: Web/CSS/-webkit-touch-callout
---
<p>{{CSSRef}} {{Non-standard_header}}</p>

<h2 id="概述">概述</h2>

<p><code>-webkit-touch-callout</code> 这个<a href="/en-US/docs/Web/CSS">CSS</a> 属性禁用了默认的callout展示, callout是指当触摸并按住一个元素的时候出现的提示。<br>
 <br>
 当在iOS上一直按住一个目标元素时,Safari会展示一个关于这个链接的callout信息。<code>webkit-touch-callout</code>属性允许禁用掉这一行为。</p>

<h2 id="Syntax" name="Syntax">语法</h2>

<pre class="twopartsyntaxbox"><a href="/en-US/docs/Web/CSS/CSS_values_syntax">Formal syntax</a>: default | none
</pre>

<pre><code class="language-html">-webkit-touch-callout: default</code>   /* displays the callout */
<code class="language-html">-webkit-touch-callout: none</code>      /* disables the callout */

<code class="language-html">-webkit-touch-callout</code>: initial
-webkit-touch-callout: inherit
-webkit-touch-callout: unset</pre>

<h3 id="可能的值">可能的值</h3>

<dl>
 <dt><code>default</code></dt>
 <dd>此值表示显示默认的callout</dd>
 <dt><code>none</code></dt>
 <dd>此值表示禁用callout</dd>
</dl>

<h2 id="示例">示例</h2>

<pre class="brush: css">.example {
  -webkit-touch-callout: none;
}
</pre>

<h2 id="Browser_Compatibility" name="Browser_Compatibility">浏览器兼容性</h2>

<p>{{ CompatibilityTable() }}</p>

<div id="compat-desktop">
<table class="compat-table">
 <tbody>
  <tr>
   <th>Feature</th>
   <th>Chrome</th>
   <th>Firefox (Gecko)</th>
   <th>Internet Explorer</th>
   <th>Opera</th>
   <th>Safari (WebKit)</th>
  </tr>
  <tr>
   <td>Basic support</td>
   <td>{{CompatNo}}</td>
   <td>{{CompatNo}}</td>
   <td>{{CompatNo}}</td>
   <td>{{CompatNo}}</td>
   <td>{{CompatVersionUnknown}}<sup>[1]</sup></td>
  </tr>
 </tbody>
</table>
</div>

<div id="compat-mobile">
<table class="compat-table">
 <tbody>
  <tr>
   <th>Feature</th>
   <th>Android</th>
   <th>Firefox Mobile (Gecko)</th>
   <th>IE Phone</th>
   <th>Opera Mobile</th>
   <th>Safari Mobile</th>
  </tr>
  <tr>
   <td>Basic support</td>
   <td>{{CompatNo}}</td>
   <td>{{CompatNo}}</td>
   <td>{{CompatNo}}</td>
   <td>{{CompatNo}}</td>
   <td>{{CompatVersionUnknown}}<sup>[1]</sup></td>
  </tr>
 </tbody>
</table>
</div>

<p>[1] <code>-webkit-touch-callout</code> 属性最早在<a href="https://developer.apple.com/library/safari/documentation/AppleApplications/Reference/SafariCSSRef/Articles/StandardCSSProperties.html#//apple_ref/css/property/-webkit-touch-callout"> iOS 2.0</a> 上实现,后来被添加到WebKit ({{webkitbug(121507)}}).</p>