From 466e82c930b0672acfa68fdeb23bc6fab4e7c0d2 Mon Sep 17 00:00:00 2001 From: Tay Jing Xuan Date: Sat, 29 Dec 2018 07:06:41 +0800 Subject: [PATCH] Translated descriptions (#21535) --- .../css/css3-nth-child-selector/index.md | 31 ++++++++++++------- 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/guide/chinese/css/css3-nth-child-selector/index.md b/guide/chinese/css/css3-nth-child-selector/index.md index c531b22b2c0..ddf3b3f79ae 100644 --- a/guide/chinese/css/css3-nth-child-selector/index.md +++ b/guide/chinese/css/css3-nth-child-selector/index.md @@ -1,27 +1,30 @@ --- title: CSS3 Nth Child Selector -localeTitle: CSS3 Nth Child Selector +localeTitle: CSS3 第`nth-child`选择器 --- -## CSS3 Nth Child Selector +## CSS3 第`nth-child`选择器 第`nth-child`选择器是一个css伪类,它采用一种模式来匹配一个或多个元素相对于它们在兄弟姐妹中的位置。 ## 句法 + ```CSS a:nth-​​child(pattern){ /* Css到这里 */ } ``` -### Pattern - - The patterns accepted by `nth-child` can come in the form of keywords or an equation of the form An+B. - - #### Keywords +### 模式 + +第`nth-child`所接受的模式可以是关键字或An+B的方程 + + #### 关键字 ##### Odd - Odd returns all odd elements of a given type. + + `Odd`会返回所属于特定类型的HTML元素当中的奇数元素。 + 在下面的示例中,所奇数的`a`元素将会被指定,而选择器中的CSS会被插入被指定的元素中。 ```CSS a:nth-​​child(odd){ @@ -31,7 +34,10 @@ localeTitle: CSS3 Nth Child Selector ``` ##### Even - Even returns all even elements of a given type. + + `Even`会返回所属于特定类型的HTML元素当中的偶数元素。 + 在下面的示例中,所位于偶数的`a`元素将会被指定,而选择器中的CSS会被插入被指定的元素中。 + ```CSS a:nth-​​child(even){ @@ -40,10 +46,11 @@ localeTitle: CSS3 Nth Child Selector ``` #### An+B + +`An+B`会返回所有属于特定类型的HTML元素中,符合An+B(n与每个正整数)的元素 +在下面的示例中,每隔三个`a`元素的元素将会被指定,而选择器中的CSS会被插入被指定的元素中。 - Returns all elements matching the equation An+B for every positive integer value of n (in addition to 0). - - For example, the following will match every 3rd anchor element: + ```CSS a:nth-​​child(3n){ /* CSS在这里 */