Skip to content

Commit bfc7c2c

Browse files
Merge pull request #156 from xunziheng/master
fixbug,and Update Chinese translation.
2 parents 9db778c + fb65e62 commit bfc7c2c

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

translations/zh-CN/README.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
1. [为更好的移动体验,为表单元素设置字体大小](#为更好的移动体验为表单元素设置字体大小)
4646
1. [使用指针事件来控制鼠标事件](#使用指针事件来控制鼠标事件)
4747
1. [在用作间距的换行符上设置`display-none`](#在用作间距的换行符上设置display-none)
48+
1. [使用 `:empty` 隐藏空 HTML 元素](#使用-empty-隐藏空-html-元素)
4849

4950

5051
### 使用CSS复位
@@ -240,7 +241,7 @@ body {
240241
}
241242
```
242243

243-
...還有CSS Grid:
244+
...还有CSS Grid:
244245

245246
```css
246247
body {
@@ -624,6 +625,20 @@ br + br {
624625

625626
<sup>[回目录](#目录)</sup>
626627

628+
### 使用 `:empty` 隐藏空 HTML 元素
629+
630+
如果你有空的 HTML 元素,即内容尚未由 CMS 设置或动态注入(例如:`<p class="error-message"></p>`)并且它会在你的布局上创建不需要的空间,使用 `:empty` 伪类隐藏布局上的元素。
631+
632+
```css
633+
:empty {
634+
display: none;
635+
}
636+
```
637+
638+
注意:请记住,带有空格的元素不会被视为空元素,例如 `<p class="error-message"> </p>`
639+
640+
<sup>[回目录](#目录)</sup>
641+
627642

628643
### 支持情况
629644

0 commit comments

Comments
 (0)