-
Notifications
You must be signed in to change notification settings - Fork 22.4k
/
index.md
61 lines (41 loc) · 1.4 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
61
---
title: ":-moz-only-whitespace"
slug: Web/CSS/:-moz-only-whitespace
page-type: css-pseudo-class
status:
- non-standard
browser-compat: css.selectors.-moz-only-whitespace
---
{{CSSRef}}{{Non-standard_header}}
> **Note:** In [Selectors Level 4](https://drafts.csswg.org/selectors-4/#the-empty-pseudo), the {{CSSxRef(":empty")}} selector was changed to act like `:-moz-only-whitespace`, but no browser currently supports this yet.
The **`:-moz-only-whitespace`** [CSS](/en-US/docs/Web/CSS) [pseudo-class](/en-US/docs/Web/CSS/Pseudo-classes) matches elements that only contain text nodes that only contain {{Glossary("whitespace")}}. (This includes elements with empty text nodes and elements with no child nodes.)
## Syntax
```css
:-moz-only-whitespace {
/* ... */
}
```
## Examples
### Simple :-moz-only-whitespace example
#### HTML
```html-nolint
<div> </div>
```
#### CSS
```css
div {
border: 4px solid red;
}
:-moz-only-whitespace {
border-color: lime;
}
```
#### Result
{{EmbedLiveSample('Simple_-moz-only-whitespace_example', '100%', 50)}}
## Specifications
Briefly defined as `:blank` in [Selectors Level 4](https://drafts.csswg.org/selectors-4/#changes-2018-02), but then the functionality was merged into {{CSSxRef(":empty")}} and {{CSSxRef(":blank")}} redefined to mean empty {{HTMLElement("input")}}.
## Browser compatibility
{{Compat}}
## See also
- {{CSSxRef(":blank")}}
- {{CSSxRef(":empty")}}