diff --git a/curriculum/challenges/chinese/01-responsive-web-design/applied-visual-design/decrease-the-opacity-of-an-element.chinese.md b/curriculum/challenges/chinese/01-responsive-web-design/applied-visual-design/decrease-the-opacity-of-an-element.chinese.md index d6d99d5a59..5922f3c6c5 100644 --- a/curriculum/challenges/chinese/01-responsive-web-design/applied-visual-design/decrease-the-opacity-of-an-element.chinese.md +++ b/curriculum/challenges/chinese/01-responsive-web-design/applied-visual-design/decrease-the-opacity-of-an-element.chinese.md @@ -17,7 +17,7 @@ localeTitle: 降低元素的不透明度 ```yml tests: - - text: 您的代码应通过选择links类将锚点标记上的opacity属性设置为0.7。 + - text: 您的代码应通过选择links类将 a 标记上的opacity属性设置为0.7。 testString: 'assert.approximately(parseFloat($(".links").css("opacity")), 0.7, 0.1, "Your code should set the opacity property to 0.7 on the anchor tags by selecting the class of links.");' ``` diff --git a/curriculum/challenges/chinese/01-responsive-web-design/basic-html-and-html5/add-a-submit-button-to-a-form.chinese.md b/curriculum/challenges/chinese/01-responsive-web-design/basic-html-and-html5/add-a-submit-button-to-a-form.chinese.md index 64e39d3af6..ae6adaa272 100644 --- a/curriculum/challenges/chinese/01-responsive-web-design/basic-html-and-html5/add-a-submit-button-to-a-form.chinese.md +++ b/curriculum/challenges/chinese/01-responsive-web-design/basic-html-and-html5/add-a-submit-button-to-a-form.chinese.md @@ -2,29 +2,36 @@ id: bad87fee1348bd9aedd08830 title: Add a Submit Button to a Form challengeType: 0 -videoUrl: '' -localeTitle: 向表单添加提交按钮 +videoUrl: 'https://scrimba.com/p/pVMPUv/cp2Nkhz' +forumTopicId: 16627 +localeTitle: 给表单添加提交按钮 --- ## Description -
我们在表单中添加一个submit按钮。单击此按钮会将表单中的数据发送到您使用表单的action属性指定的URL。这是一个示例提交按钮: <button type="submit">this button submits the form</button>
+
+让我们来给表单添加一个submit提交按钮,当点击提交按钮时,表单中的数据将会被发送到action属性指定的 URL 上。 +例如: +<button type="submit">this button submits the form</button> +
## Instructions -
添加一个按钮作为form元素的最后一个元素,其类型为submit ,并且“Submit”作为其文本。
+
+在表单的底部创建一个button按钮,按钮的type属性值为submit,文本为提交。 +
## Tests
```yml tests: - - text: 你的表单里面应该有一个按钮。 - testString: 'assert($("form").children("button").length > 0, "Your form should have a button inside it.");' - - text: 您的提交按钮应该具有要submit的属性type 。 - testString: 'assert($("button").attr("type") === "submit", "Your submit button should have the attribute type set to submit.");' - - text: 您的提交按钮应该只有“提交”文本。 - testString: 'assert($("button").text().match(/^\s*submit\s*$/gi), "Your submit button should only have the text "Submit".");' - - text: 确保您的button元素有一个结束标记。 - testString: 'assert(code.match(/<\/button>/g) && code.match(/
## Solution
- -```js -

CatPhotoApp

-
-

Click here to view more cat photos.

- - A cute orange cat lying on its back. - -

Things cats love:

- -

Top 3 things cats hate:

-
    -
  1. flea treatment
  2. -
  3. thunder
  4. -
  5. other cats
  6. -
-
- - -
-
-```
+ \ No newline at end of file diff --git a/curriculum/challenges/chinese/01-responsive-web-design/basic-html-and-html5/add-images-to-your-website.chinese.md b/curriculum/challenges/chinese/01-responsive-web-design/basic-html-and-html5/add-images-to-your-website.chinese.md index b24f331dfe..5bacf87681 100644 --- a/curriculum/challenges/chinese/01-responsive-web-design/basic-html-and-html5/add-images-to-your-website.chinese.md +++ b/curriculum/challenges/chinese/01-responsive-web-design/basic-html-and-html5/add-images-to-your-website.chinese.md @@ -2,27 +2,44 @@ id: bad87fee1348bd9aedf08812 title: Add Images to Your Website challengeType: 0 -videoUrl: '' -localeTitle: 添加图片到您的网站 +videoUrl: 'https://scrimba.com/p/pVMPUv/c8EbJf2' +forumTopicId: 16640 +localeTitle: 给网站添加图片 --- ## Description -
您可以使用img元素将图像添加到网站,并使用src属性指向特定图像的URL。这方面的一个例子是: <img src="https://www.your-image-source.com/your-image.jpg">请注意, img元素是自动关闭的。所有img元素都必须具有alt属性。 alt属性中的文本用于屏幕阅读器以提高可访问性,并在图像无法加载时显示。注意:如果图像纯粹是装饰性的,则使用空的alt属性是最佳做法。理想情况下,除非需要,否则alt属性不应包含特殊字符。让我们在上面的img示例中添加一个alt属性: <img src="https://www.your-image-source.com/your-image.jpg" alt="Author standing on a beach with two thumbs up.">
+
+用img元素来为你的网站添加图片,其中src属性指向一个图片的地址。 +例如: +<img src="https://www.your-image-source.com/your-image.jpg"> +注意:img元素是没有结束标记的。 +所有的img元素必须有alt属性,alt属性的文本是当图片无法加载时显示的替代文本,这对于通过屏幕阅读器来浏览网页的用户非常重要。 +注意:如果图片是纯装饰性的,用一个空的alt是最佳实践。 +理想情况下,alt属性不应该包含特殊字符,除非必要。 +让我们给上面例子的img添加alt属性。 +<img src="https://www.your-image-source.com/your-image.jpg" alt="作者站在沙滩上竖起两个大拇指"> +
## Instructions -
让我们尝试将图像添加到我们的网站:在h2元素之前插入img标记。现在设置src属性,使其指向此URL: https://bit.ly/fcc-relaxing-cathttps://bit.ly/fcc-relaxing-cat最后不要忘记为您的图像添加alt文字。
+
+让我们给网站添加图片: +在h2元素前,插入一个img元素 +现在设置src属性指向这个地址: +https://bit.ly/fcc-relaxing-cat +最后不要忘记给图片添加一个alt文本。 +
## Tests
```yml tests: - - text: 您的页面应该有一个图像元素。 - testString: 'assert($("img").length > 0, "Your page should have an image element.");' - - text: 您的图像应具有指向小猫图像的src属性。 - testString: 'assert(new RegExp("\/\/bit.ly\/fcc-relaxing-cat|\/\/s3.amazonaws.com\/freecodecamp\/relaxing-cat.jpg", "gi").test($("img").attr("src")), "Your image should have a src attribute that points to the kitten image.");' - - text: 您的图片元素必须具有alt属性。 - testString: 'assert(code.match(/alt\s*?=\s*?(\"|\").*(\"|\")/), "Your image element must have an alt attribute.");' + - text: '网页应该有一张图片。' + testString: assert($("img").length > 0); + - text: '图片 src 属性应该为 https://bit.ly/fcc-relaxing-cat。' + testString: assert(/^https:\/\/bit\.ly\/fcc-relaxing-cat$/i.test($("img").attr("src"))); + - text: '图片必须有alt属性。' + testString: assert(code.match(/alt\s*?=\s*?(\"|\').*(\"|\')/)); ``` @@ -36,12 +53,11 @@ tests: ```html

CatPhotoApp

- - -

Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.

-

Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.

+ + +

在大家心目中,猫是慵懒和可爱的化身,它可以睡饱了再起来吃饭,可以逗趣小耗子,可以卖得了萌,使得了坏,这样百变的小怪兽就集结在一只宠物上,怎能不惹人怜爱。

+

养猫有的时候,就是介于爱与恨之间,当你钦羡别人萌宠这么可爱的时候,你一定没有想过,猫咪会到处掉毛,甚至会囤老鼠,啃鞋子,用爪子爬门,你不理它,它就挠你,你要对它发脾气,它会比你更来劲。所以,没有一定的准备,切勿随便去侍养动物。它们一旦认定你了,你就是它们的主人,如果你抛弃它们,它们必定心中重创。

- ``` @@ -52,8 +68,5 @@ tests: ## Solution
- -```js -// solution required -```
+ \ No newline at end of file diff --git a/curriculum/challenges/chinese/01-responsive-web-design/basic-html-and-html5/add-placeholder-text-to-a-text-field.chinese.md b/curriculum/challenges/chinese/01-responsive-web-design/basic-html-and-html5/add-placeholder-text-to-a-text-field.chinese.md index 60cec3fa42..82c82edec1 100644 --- a/curriculum/challenges/chinese/01-responsive-web-design/basic-html-and-html5/add-placeholder-text-to-a-text-field.chinese.md +++ b/curriculum/challenges/chinese/01-responsive-web-design/basic-html-and-html5/add-placeholder-text-to-a-text-field.chinese.md @@ -2,28 +2,34 @@ id: bad87fee1348bd9aedf08830 title: Add Placeholder Text to a Text Field challengeType: 0 -videoUrl: '' -localeTitle: 将占位符文本添加到文本字段 +videoUrl: 'https://scrimba.com/p/pVMPUv/cKdJDhg' +forumTopicId: 16647 +localeTitle: 给输入框添加占位符文本 --- ## Description -
占位符文本是在用户输入任何内容之前在input元素中显示的内容。您可以像这样创建占位符文本: <input type="text" placeholder="this is placeholder text">
+
+Placeholder占位符是用户在input输入框中输入任何东西前的预定义文本。 +你可以像这样创建一个占位符: +<input type="text" placeholder="this is placeholder text"> +
## Instructions -
将文本inputplaceholder值设置为“cat photo URL”。
+
+把input输入框的placeholder占位符文本设置为 “猫咪图片地址”。 +
## Tests
```yml tests: - - text: 将placeholder属性添加到现有文本input元素。 - testString: 'assert($("input[placeholder]").length > 0, "Add a placeholder attribute to the existing text input element.");' - - text: 将占位符属性的值设置为“cat photo URL”。 - testString: 'assert($("input") && $("input").attr("placeholder") && $("input").attr("placeholder").match(/cat\s+photo\s+URL/gi), "Set the value of your placeholder attribute to "cat photo URL".");' - - text: 完成的input元素应该具有有效的语法。 - testString: 'assert($("input[type=text]").length > 0 && code.match(/\s]+))?)+\s*|\s*)\/?>/gi), "The finished input element should have valid syntax.");' - + - text: '给现有的input输入框添加一个placeholder属性。' + testString: assert($("input[placeholder]").length > 0); + - text: '设置placeholder属性的值为 ”猫咪图片地址“。' + testString: assert($("input") && $("input").attr("placeholder") && $("input").attr("placeholder").match(/猫咪图片地址/gi)); + - text: 'input输入框的语法必须正确。' + testString: 'assert($("input[type=text]").length > 0 && code.match(/\s]+))?)+\s*|\s*)\/?>/gi));' ```
@@ -36,25 +42,24 @@ tests: ```html

CatPhotoApp

-

Click here to view more cat photos.

- - A cute orange cat lying on its back. - -

Things cats love:

+

点击查看更多猫咪图片

+ + 一只仰卧着的萌猫 + +

猫咪最喜欢的三件东西:

-

Top 3 things cats hate:

+

猫咪最讨厌的三件东西:

    -
  1. flea treatment
  2. -
  3. thunder
  4. -
  5. other cats
  6. +
  7. 跳蚤
  8. +
  9. 打雷
  10. +
  11. 同类
- ``` @@ -65,8 +70,5 @@ tests: ## Solution
- -```js -// solution required -```
+ \ No newline at end of file diff --git a/curriculum/challenges/chinese/01-responsive-web-design/basic-html-and-html5/check-radio-buttons-and-checkboxes-by-default.chinese.md b/curriculum/challenges/chinese/01-responsive-web-design/basic-html-and-html5/check-radio-buttons-and-checkboxes-by-default.chinese.md index 74a8dc1cc8..4be0065f73 100644 --- a/curriculum/challenges/chinese/01-responsive-web-design/basic-html-and-html5/check-radio-buttons-and-checkboxes-by-default.chinese.md +++ b/curriculum/challenges/chinese/01-responsive-web-design/basic-html-and-html5/check-radio-buttons-and-checkboxes-by-default.chinese.md @@ -2,25 +2,31 @@ id: bad87fee1348bd9aedd08835 title: Check Radio Buttons and Checkboxes by Default challengeType: 0 -videoUrl: '' -localeTitle: 默认情况下检查单选按钮和复选框 +videoUrl: 'https://scrimba.com/p/pVMPUv/cWk3Qh6' +forumTopicId: 301094 +localeTitle: 给单选按钮和复选框添加默认选中项 --- ## Description -
您可以使用checked属性设置默认情况下要选中的复选框或单选按钮。为此,只需将“checked”一词添加到input元素的内部即可。例如: <input type="radio" name="test-name" checked>
+
+如果想设置某个单选按钮或多选按钮默认被选中,只需给input元素添加 "checked" 属性。 例如: +<input type="radio" name="test-name" checked> +
## Instructions -
默认情况下,设置第一个radio buttons和第一个checkboxes
+
+把第一个radio button和第一个checkbox都设置为默认选中。 +
## Tests
```yml tests: - - text: 默认情况下,应检查表单上的第一个单选按钮。 - testString: 'assert($("input[type="radio"]").prop("checked"), "Your first radio button on your form should be checked by default.");' - - text: 默认情况下,应检查表单上的第一个复选框。 - testString: 'assert($("input[type="checkbox"]").prop("checked"), "Your first checkbox on your form should be checked by default.");' + - text: '表单的第一个单选按钮应该被默认选中。' + testString: assert($('input[type="radio"]').prop("checked")); + - text: '表单的第一个多选按钮应该被默认选中。' + testString: assert($('input[type="checkbox"]').prop("checked")); ``` @@ -34,33 +40,32 @@ tests: ```html

CatPhotoApp

-

Click here to view more cat photos.

- - A cute orange cat lying on its back. - -

Things cats love:

+

点击查看更多猫咪图片

+ + 一只仰卧着的萌猫 + +

猫咪最喜欢的三件东西:

    -
  • cat nip
  • -
  • laser pointers
  • -
  • lasagna
  • +
  • 猫薄荷
  • +
  • 激光笔
  • +
  • 千层饼
-

Top 3 things cats hate:

+

猫咪最讨厌的三件东西:

    -
  1. flea treatment
  2. -
  3. thunder
  4. -
  5. other cats
  6. +
  7. 跳蚤
  8. +
  9. 打雷
  10. +
  11. 同类
- -
- - -
- - + +
+ + +
+ +
- ``` @@ -71,8 +76,5 @@ tests: ## Solution
- -```js -// solution required -```
+ \ No newline at end of file diff --git a/curriculum/challenges/chinese/01-responsive-web-design/basic-html-and-html5/comment-out-html.chinese.md b/curriculum/challenges/chinese/01-responsive-web-design/basic-html-and-html5/comment-out-html.chinese.md index 6c4e01a924..14a60d3f68 100644 --- a/curriculum/challenges/chinese/01-responsive-web-design/basic-html-and-html5/comment-out-html.chinese.md +++ b/curriculum/challenges/chinese/01-responsive-web-design/basic-html-and-html5/comment-out-html.chinese.md @@ -2,31 +2,37 @@ id: bad87fee1348bd9aedf08804 title: Comment out HTML challengeType: 0 -videoUrl: '' -localeTitle: 评论HTML +videoUrl: 'https://scrimba.com/p/pVMPUv/cGyGbca' +forumTopicId: 16782 +localeTitle: 给 HTML 添加注释 --- ## Description -
请记住,为了开始评论,您需要使用<!--并结束评论,您需要使用-->这里您需要在h2元素开始之前结束评论。
+
+记住:注释的开始标记是<!--,结束标记是-->。 +现在你需要在h2元素前终止注释。 +
## Instructions -
注释掉你的h1元素和你的p元素,但不是你的h2元素。
+
+任务:注释掉h1元素和p元素,保留h2元素。 +
## Tests
```yml tests: - - text: 注释掉你的h1元素,使其在你的页面上不可见。 - testString: 'assert(($("h1").length === 0), "Comment out your h1 element so that it is not visible on your page.");' - - text: 保持h2元素取消注释,以便在页面上显示。 - testString: 'assert(($("h2").length > 0), "Leave your h2 element uncommented so that it is visible on your page.");' - - text: 注释掉你的p元素,使其在你的页面上不可见。 - testString: 'assert(($("p").length === 0), "Comment out your p element so that it is not visible on your page.");' - - text: 请务必使用-->关闭每条评论。 - testString: 'assert(code.match(/[^fc]-->/g).length > 1, "Be sure to close each of your comments with -->.");' - - text: 请勿更改代码中h1 h2p的顺序。 - testString: 'assert((code.match(/<([a-z0-9]){1,2}>/g)[0]==="

" && code.match(/<([a-z0-9]){1,2}>/g)[1]==="

" && code.match(/<([a-z0-9]){1,2}>/g)[2]==="

") , "Do not change the order of the h1 h2 or p in the code.");' + - text: '注释掉h1元素,这样它就从网页上消失了。' + testString: assert(($("h1").length === 0)); + - text: 'h2元素保持原样,这样网页上还能看到它。' + testString: assert(($("h2").length > 0)); + - text: '注释掉p元素,这样它就从网页上消失了。' + testString: assert(($("p").length === 0)); + - text: '确保每一个注释都以-->结尾。' + testString: assert(code.match(/[^fc]-->/g).length > 1); + - text: '不要更改h1元素、h2 元素、p元素的顺序。' + testString: assert((code.match(/<([a-z0-9]){1,2}>/g)[0]==="

" && code.match(/<([a-z0-9]){1,2}>/g)[1]==="

" && code.match(/<([a-z0-9]){1,2}>/g)[2]==="

")); ``` @@ -43,9 +49,8 @@ tests:

CatPhotoApp

-

Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.

+

在大家心目中,猫是慵懒和可爱的化身,它可以睡饱了再起来吃饭,可以逗趣小耗子,可以卖得了萌,使得了坏,这样百变的小怪兽就集结在一只宠物上,怎能不惹人怜爱。

--> - ``` @@ -56,8 +61,5 @@ tests: ## Solution
- -```js -// solution required -```
+ \ No newline at end of file diff --git a/curriculum/challenges/chinese/01-responsive-web-design/basic-html-and-html5/create-a-bulleted-unordered-list.chinese.md b/curriculum/challenges/chinese/01-responsive-web-design/basic-html-and-html5/create-a-bulleted-unordered-list.chinese.md index 5dbace9ae0..3fa2bf16e1 100644 --- a/curriculum/challenges/chinese/01-responsive-web-design/basic-html-and-html5/create-a-bulleted-unordered-list.chinese.md +++ b/curriculum/challenges/chinese/01-responsive-web-design/basic-html-and-html5/create-a-bulleted-unordered-list.chinese.md @@ -2,31 +2,46 @@ id: bad87fee1348bd9aedf08827 title: Create a Bulleted Unordered List challengeType: 0 -videoUrl: '' -localeTitle: 创建项目符号无序列表 +videoUrl: 'https://scrimba.com/p/pVMPUv/cDKVPuv' +forumTopicId: 16814 +localeTitle: 创建一个无序列表 --- ## Description -
HTML具有用于创建unordered lists或项目符号样式列表的特殊元素。无序列表以开头<ul>元素开头,后跟任意数量的<li>元素。最后,无序列表以</ul>结尾例如:
<UL>
<LI>乳</ LI>
<LI>干酪</ LI>
</ UL>
会创建一个“牛奶”和“奶酪”的子弹点样式列表。
+
+HTML 有一个特定的元素用于创建无序列表unordered lists(缩写 ul)。 +无序列表以<ul>开始,中间包含一个或多个<li>元素,最后以</ul>结尾。 +例如: + +```html +
    +
  • 牛奶
  • +
  • 奶酪
  • +
+``` + +将会创建一个包含牛奶和奶酪的无序列表。 +
## Instructions -
删除最后两个p元素,并在页面底部创建猫喜爱的三件事的无序列表。
+
+删除页面底部的两个p元素,然后在底部创建一个无序列表,其中包含你认为猫咪最喜欢的三件东西。 +
## Tests
```yml tests: - - text: 创建一个ul元素。 - testString: 'assert($("ul").length > 0, "Create a ul element.");' - - text: 你的ul元素中应该有三个li元素。 - testString: 'assert($("ul li").length > 2, "You should have three li elements within your ul element.");' - - text: 确保你的ul元素有一个结束标记。 - testString: 'assert(code.match(/<\/ul>/gi) && code.match(/
    /gi).length === code.match(/
      ul element has a closing tag.");' - - text: 确保您的li元素具有结束标记。 - testString: 'assert(code.match(/<\/li>/gi) && code.match(/]/gi) && code.match(/<\/li>/gi).length === code.match(/]/gi).length, "Make sure your li elements have closing tags.");' - - text: 确保您的li元素不包含任何空字符串或者只有空格。 - testString: assert($("ul li").filter((_, item) => !$(item).text().trim()).length === 0, 'Make sure your li elements don\’t contain an empty string or only white-space.'); + - text: '创建一个ul无序列表。' + testString: assert($("ul").length > 0); + - text: '你应该在ul无序列表中添加三个li条目。' + testString: assert($("ul li").length > 2); + - text: '确保ul无序列表有结束标记。' + testString: assert(code.match(/<\/ul>/gi) && code.match(/
        /gi).length === code.match(/
          li条目都有结束标记。' + testString: assert(code.match(/<\/li>/gi) && code.match(/]/gi) && code.match(/<\/li>/gi).length === code.match(/]/gi).length); + ```
@@ -39,14 +54,12 @@ tests: ```html

CatPhotoApp

-

Click here to view more cat photos.

- - A cute orange cat lying on its back. - -

Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.

-

Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.

+ + 一只仰卧着的萌猫 + +

在大家心目中,猫是慵懒和可爱的化身,它可以睡饱了再起来吃饭,可以逗趣小耗子,可以卖得了萌,使得了坏,这样百变的小怪兽就集结在一只宠物上,怎能不惹人怜爱。

+

养猫有的时候,就是介于爱与恨之间,当你钦羡别人萌宠这么可爱的时候,你一定没有想过,猫咪会到处掉毛,甚至会屯老鼠,啃鞋子,用爪子爬门,你不理它,它就挠你,你要对它发脾气,它会比你更来劲。所以,猫咪慎入,没有一定的准备,切勿随便去侍养动物。它们一旦认定你了,你就是它们的主人,如果你抛弃它们,它们必定心中重创。

- ``` @@ -57,21 +70,5 @@ tests: ## Solution
- -```js -

CatPhotoApp

-
-

Click here to view more cat photos.

- - A cute orange cat lying on its back. - - Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff. - Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched. -
    -
  • milk
  • -
  • food
  • -
  • toys
  • -
-
-```
+ \ No newline at end of file diff --git a/curriculum/challenges/chinese/01-responsive-web-design/basic-html-and-html5/create-a-form-element.chinese.md b/curriculum/challenges/chinese/01-responsive-web-design/basic-html-and-html5/create-a-form-element.chinese.md index dafa4d7e64..6010633cea 100644 --- a/curriculum/challenges/chinese/01-responsive-web-design/basic-html-and-html5/create-a-form-element.chinese.md +++ b/curriculum/challenges/chinese/01-responsive-web-design/basic-html-and-html5/create-a-form-element.chinese.md @@ -2,27 +2,34 @@ id: bad87fee1348bd9aede08830 title: Create a Form Element challengeType: 0 -videoUrl: '' -localeTitle: 创建表单元素 +videoUrl: 'https://scrimba.com/p/pVMPUv/cmQ3Kfa' +forumTopicId: 16817 +localeTitle: 创建一个表单 --- ## Description -
您可以使用纯HTML来构建实际将数据提交到服务器的Web表单。您可以通过在form元素上指定操作来执行此操作。例如: <form action="/url-where-you-want-to-submit-form-data"></form>
+
+如果想使用 HTML 向服务器提交数据,可以给form添加action属性。 +例如: +<form action="/url-where-you-want-to-submit-form-data"></form> +
## Instructions -
将文本字段嵌套在form元素中,并将action="/submit-cat-photo"属性添加到表单元素中。
+
+在input输入框外层创建一个form表单,然后设置表单的action属性为"/submit-cat-photo"。 +
## Tests
```yml tests: - - text: 将文本输入元素嵌套在form元素中。 - testString: 'assert($("form") && $("form").children("input") && $("form").children("input").length > 0, "Nest your text input element within a form element.");' - - text: 确保您的form具有设置为/submit-cat-photoaction属性 - testString: 'assert($("form").attr("action") === "/submit-cat-photo", "Make sure your form has an action attribute which is set to /submit-cat-photo");' - - text: 确保您的form元素具有格式良好的打开和关闭标记。 - testString: 'assert(code.match(/<\/form>/g) && code.match(/
/g) && code.match(/<\/form>/g).length === code.match(//g).length, "Make sure your form element has well-formed open and close tags.");' + - text: '在input输入框外层创建一个form表单。' + testString: assert($("form") && $("form").children("input") && $("form").children("input").length > 0); + - text: '确保表单的action属性为"/submit-cat-photo"。' + testString: assert($("form").attr("action") === "/submit-cat-photo"); + - text: '确保表单有开始标记和结束标记。' + testString: assert(code.match(/<\/form>/g) && code.match(//g) && code.match(/<\/form>/g).length === code.match(//g).length); ``` @@ -36,25 +43,24 @@ tests: ```html

CatPhotoApp

-

Click here to view more cat photos.

- - A cute orange cat lying on its back. - -

Things cats love:

+

点击查看更多猫咪图片

+ + 一只仰卧着的萌猫 + +

猫咪最喜欢的三件东西:

    -
  • cat nip
  • -
  • laser pointers
  • -
  • lasagna
  • +
  • 猫薄荷
  • +
  • 激光笔
  • +
  • 千层饼
-

Top 3 things cats hate:

+

猫咪最讨厌的三件东西:

    -
  1. flea treatment
  2. -
  3. thunder
  4. -
  5. other cats
  6. +
  7. 跳蚤
  8. +
  9. 打雷
  10. +
  11. 同类
- +
- ``` @@ -65,8 +71,5 @@ tests: ## Solution
- -```js -// solution required -```
+ \ No newline at end of file diff --git a/curriculum/challenges/chinese/01-responsive-web-design/basic-html-and-html5/create-a-set-of-checkboxes.chinese.md b/curriculum/challenges/chinese/01-responsive-web-design/basic-html-and-html5/create-a-set-of-checkboxes.chinese.md index 18cb96b2fd..c9070bc739 100644 --- a/curriculum/challenges/chinese/01-responsive-web-design/basic-html-and-html5/create-a-set-of-checkboxes.chinese.md +++ b/curriculum/challenges/chinese/01-responsive-web-design/basic-html-and-html5/create-a-set-of-checkboxes.chinese.md @@ -2,29 +2,42 @@ id: bad87fee1348bd9aedf08835 title: Create a Set of Checkboxes challengeType: 0 -videoUrl: '' +videoUrl: 'https://scrimba.com/p/pVMPUv/cqrkJsp' +forumTopicId: 16821 localeTitle: 创建一组复选框 --- ## Description -
表单通常使用checkboxes来表示可能有多个答案的问题。复选框是一种类型的input您的每一个复选框可以嵌套自身的内label元素。通过将input元素包装在label元素内部,它将自动将复选框输入与其周围的标签元素相关联。所有相关的复选框输入应具有相同的name属性。通过在label元素上设置for属性以匹配关联input元素的id属性,最佳做法是明确定义复选框input与其对应label之间的关系。这是一个复选框的示例: <label for="loving"><input id="loving" type="checkbox" name="personality"> Loving</label>
+
+checkboxes(复选框)就好比多项选择题,正确答案有多个。 +复选框是input选择框的另一种类型。 +每一个复选框都应该嵌套在它自己的label(标签)元素中。 +所有关联的复选框应该拥有相同的name属性。 +最佳实践是在label元素上设置for属性,让其值与复选框的id属性值相等,这样就在label元素和它的子元素复选框之间创建了一种链接关系。例如: +下面是一个复选框的例子: +<label for="loving"><input id="loving" type="checkbox" name="personality"> Loving</label> +
## Instructions -
在表单中添加一组三个复选框。每个复选框应嵌套在自己的label元素中。这三者都应该分享personalityname属性。
+
+给表单添加三个复选框,每个复选框都被嵌套进label元素中,并且它的name属性均为personality,它们的内容可以随意指定。 +
## Tests
```yml tests: - - text: 您的页面应该有三个复选框元素。 - testString: 'assert($("input[type="checkbox"]").length > 2, "Your page should have three checkbox elements.");' - - text: 三个复选框元素中的每一个都应嵌套在自己的label元素中。 - testString: 'assert($("label > input[type="checkbox"]:only-child").length > 2, "Each of your three checkbox elements should be nested in its own label element.");' - - text: 确保每个label元素都有一个结束标记。 - testString: 'assert(code.match(/<\/label>/g) && code.match(/