aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/css/_colon_blank/index.html
blob: ee0cfeceee5a5a0020562a7651cc62c31bd574ac (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
---
title: ':blank'
slug: Web/CSS/:blank
tags:
  - CSS
  - CSS 选择器
  - 伪类
translation_of: Web/CSS/:blank
original_slug: Web/CSS/:blank空白伪类
---
<p>{{CSSRef}}{{Draft}}{{SeeCompatTable}}</p>

<div class="blockIndicator note">
<p><strong>注意:</strong>使用 <code>:blank</code> 选择器被认为尚有一定风险,CSSWG 正在持续改进它。</p>

<p>详见<a href="https://github.com/w3c/csswg-drafts/issues/1967" title="[selectors] decide on :blank"> CSSWG issue #1967</a></p>
</div>

<p><strong><code>:blank</code></strong> <a href="/en-US/docs/Web/CSS">CSS</a> <a href="/zh-CN/docs/Web/CSS/Pseudo-classes">伪类</a>选择器选择用户输入为空的输入框,如 {{HTMLElement("input")}}{{HTMLElement("textarea")}})。</p>

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

<pre class="syntaxbox">{{CSSSyntax}}</pre>

<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 Selectors", "#blank-pseudo", ":blank")}}</td>
   <td>{{Spec2("CSS4 Selectors")}}</td>
   <td>Initial definition.</td>
  </tr>
 </tbody>
</table>

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

<div class="hidden">此页上的兼容性表由结构化数据生成。如果您想贡献数据,请查看https://github.com/mdn/browser-compat-data并发送给我们请求。</div>

<div class="hidden">如果你想得到更多信息,请查看:<a href="https://www.w3.org/TR/selectors-4/#blank-pseudo">https://www.w3.org/TR/selectors-4/#blank-pseudo</a></div>

<p>{{Compat("css.selectors.blank")}}</p>

<h2 id="参见">参见</h2>

<ul>
 <li>{{CSSxRef(":empty")}}</li>
 <li>{{CSSxRef(":-moz-only-whitespace")}} {{Non-standard_Inline}} - The previous definition of <code>:blank</code>.</li>
</ul>