-
Notifications
You must be signed in to change notification settings - Fork 22.4k
/
index.md
60 lines (40 loc) · 1.1 KB
/
index.md
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
---
title: ":blank"
slug: Web/CSS/:blank
page-type: css-pseudo-class
status:
- experimental
browser-compat: css.selectors.blank
---
{{CSSRef}}{{SeeCompatTable}}
> **Note:** The `:blank` selector is considered at risk, as the CSSWG keeps changing it.
>
> See [CSSWG issue #1967](https://github.com/w3c/csswg-drafts/issues/1967).
The **`:blank`** [CSS](/en-US/docs/Web/CSS) [pseudo-class](/en-US/docs/Web/CSS/Pseudo-classes) selects empty user input elements (e.g. {{HTMLElement("input")}} or {{HTMLElement("textarea")}}).
## Syntax
```css
:blank {
/* ... */
}
```
## Examples
### Simple :blank example
In eventual supporting browsers, the `:blank` pseudo-class will enable developers to highlight in some way input controls that are not required, but still have no content filled in, perhaps as a reminder to users.
#### HTML
```html
<textarea></textarea>
```
#### CSS
```css
textarea:blank {
border: 3px solid red;
}
```
#### Result
{{EmbedLiveSample('Simple_blank_example', '100%', 150)}}
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
## See also
- {{CSSxRef(":empty")}}