chore(i18n,curriculum): update translations (#42070)
This commit is contained in:
@ -37,7 +37,7 @@ dashedName: add-images-to-your-website
|
||||
|
||||
在 `main` 元素里,给 `p` 元素前面插入一个 `img` 元素。
|
||||
|
||||
现在设置 `src` 属性,以便它指向网址 `https://bit.ly/fcc-relaxing-cat`
|
||||
现在设置 `src` 属性,使它指向网址 `https://www.bit.ly/fcc-relaxing-cat`。
|
||||
|
||||
最后,不要忘记给 `img` 加上 `alt` 属性。
|
||||
|
||||
@ -52,7 +52,7 @@ assert($('img').length);
|
||||
你的图片应该有一个 `src` 属性,其值为猫咪图片的 url。
|
||||
|
||||
```js
|
||||
assert(/^https:\/\/bit\.ly\/fcc-relaxing-cat$/i.test($('img').attr('src')));
|
||||
assert(/^https:\/\/(www\.)?bit\.ly\/fcc-relaxing-cat$/i.test($('img').attr('src')));
|
||||
```
|
||||
|
||||
你的图片元素的 `alt` 属性值不应为空。
|
||||
@ -86,7 +86,7 @@ assert(
|
||||
```html
|
||||
<h2>CatPhotoApp</h2>
|
||||
<main>
|
||||
<a href="#"><img src="https://bit.ly/fcc-relaxing-cat" alt="A cute orange cat lying on its back."></a>
|
||||
<a href="#"><img src="https://www.bit.ly/fcc-relaxing-cat" alt="A cute orange cat lying on its back."></a>
|
||||
<p>Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
|
||||
<p>Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>
|
||||
</main>
|
||||
|
@ -20,7 +20,7 @@ dashedName: create-a-form-element
|
||||
|
||||
# --instructions--
|
||||
|
||||
把现有的 `input` 输入框放到一个新建的表单 `form` 里,然后设置 `form` 元素的 `action` 属性值为 `"https://freecatphotoapp.com/submit-cat-photo"`。
|
||||
把现有的 `input` 元素嵌套到一个表单 `form` 元素里,然后设置 `form` 元素的 `action` 属性值为 `"https://www.freecatphotoapp.com/submit-cat-photo"`。
|
||||
|
||||
# --hints--
|
||||
|
||||
@ -34,12 +34,11 @@ assert(
|
||||
);
|
||||
```
|
||||
|
||||
`form` 的 `action` 属性值应设置为 `https://freecatphotoapp.com/submit-cat-photo`。
|
||||
`form` 的 `action` 属性值应为 `https://www.freecatphotoapp.com/submit-cat-photo`。
|
||||
|
||||
```js
|
||||
assert(
|
||||
$('form').attr('action') === 'https://freecatphotoapp.com/submit-cat-photo'
|
||||
);
|
||||
const action = $('form').attr('action');
|
||||
assert(action.match(/^https:\/\/(www\.)?freecatphotoapp\.com\/submit-cat-photo$/i))
|
||||
```
|
||||
|
||||
`form` 元素应有开始标签和结束标签。
|
||||
@ -61,7 +60,7 @@ assert(
|
||||
<main>
|
||||
<p>Click here to view more <a href="#">cat photos</a>.</p>
|
||||
|
||||
<a href="#"><img src="https://bit.ly/fcc-relaxing-cat" alt="A cute orange cat lying on its back."></a>
|
||||
<a href="#"><img src="https://www.bit.ly/fcc-relaxing-cat" alt="A cute orange cat lying on its back."></a>
|
||||
|
||||
<p>Things cats love:</p>
|
||||
<ul>
|
||||
@ -86,7 +85,7 @@ assert(
|
||||
<main>
|
||||
<p>Click here to view more <a href="#">cat photos</a>.</p>
|
||||
|
||||
<a href="#"><img src="https://bit.ly/fcc-relaxing-cat" alt="A cute orange cat lying on its back."></a>
|
||||
<a href="#"><img src="https://www.bit.ly/fcc-relaxing-cat" alt="A cute orange cat lying on its back."></a>
|
||||
|
||||
<p>Things cats love:</p>
|
||||
<ul>
|
||||
@ -100,7 +99,7 @@ assert(
|
||||
<li>thunder</li>
|
||||
<li>other cats</li>
|
||||
</ol>
|
||||
<form action="https://freecatphotoapp.com/submit-cat-photo">
|
||||
<form action="https://www.freecatphotoapp.com/submit-cat-photo">
|
||||
<input type="text" placeholder="cat photo URL">
|
||||
</form>
|
||||
</main>
|
||||
|
@ -26,9 +26,9 @@ HTML5 引入了很多更具描述性的 HTML 元素, 包括 `main`、`header`
|
||||
|
||||
# --instructions--
|
||||
|
||||
请在现有的 `p` 之后创建一个新的 `p` 元素,内容为:`Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.`
|
||||
创建一个新的 `p` 元素,内容为:`Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.`
|
||||
|
||||
然后,请添加一个 `main` 元素,作为现有的两个 `p` 元素的父级元素。
|
||||
然后,请添加一个 `main` 元素,将现有的两个 `p` 元素嵌套在这个 `main` 元素里。
|
||||
|
||||
# --hints--
|
||||
|
||||
|
@ -14,14 +14,14 @@ dashedName: link-to-external-pages-with-anchor-elements
|
||||
`a` 需要一个 `href` 属性指向跳转的目的地。 同时,它还应有内容。 例如:
|
||||
|
||||
```html
|
||||
<a href="https://freecodecamp.org">this links to freecodecamp.org</a>
|
||||
<a href="https://www.freecodecamp.org">this links to freecodecamp.org</a>
|
||||
```
|
||||
|
||||
浏览器将显示文本 `this links to freecodecamp.org`,这是一个可点击的链接。 你可以通过这个链接访问 `https://www.freecodecamp.org`。
|
||||
|
||||
# --instructions--
|
||||
|
||||
创建一个内容文本为 “cat photos” 的 `a` 元素,链接指向 `https://freecatphotoapp.com`。
|
||||
创建一个内容文本为 “cat photos” 的 `a` 元素,链接指向 `https://www.freecatphotoapp.com`。
|
||||
|
||||
# --hints--
|
||||
|
||||
@ -31,10 +31,10 @@ dashedName: link-to-external-pages-with-anchor-elements
|
||||
assert(/cat photos/gi.test($('a').text()));
|
||||
```
|
||||
|
||||
你的 `a` 元素应链接到 `https://freecatphotoapp.com`
|
||||
`a` 元素应链接到 `https://www.freecatphotoapp.com`。
|
||||
|
||||
```js
|
||||
assert(/^https?:\/\/freecatphotoapp\.com\/?$/i.test($('a').attr('href')));
|
||||
assert(/^https?:\/\/(www\.)?freecatphotoapp\.com\/?$/i.test($('a').attr('href')));
|
||||
```
|
||||
|
||||
确保 `a` 元素有结束标签。
|
||||
@ -56,7 +56,7 @@ assert(
|
||||
|
||||
|
||||
|
||||
<img src="https://bit.ly/fcc-relaxing-cat" alt="A cute orange cat lying on its back.">
|
||||
<img src="https://www.bit.ly/fcc-relaxing-cat" alt="A cute orange cat lying on its back.">
|
||||
|
||||
<p>Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
|
||||
<p>Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>
|
||||
@ -69,9 +69,9 @@ assert(
|
||||
<h2>CatPhotoApp</h2>
|
||||
<main>
|
||||
|
||||
<img src="https://bit.ly/fcc-relaxing-cat" alt="A cute orange cat lying on its back.">
|
||||
<img src="https://www.bit.ly/fcc-relaxing-cat" alt="A cute orange cat lying on its back.">
|
||||
|
||||
<a href="https://freecatphotoapp.com">cat photos</a>
|
||||
<a href="https://www.freecatphotoapp.com">cat photos</a>
|
||||
<p>Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
|
||||
<p>Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>
|
||||
</main>
|
||||
|
@ -15,7 +15,7 @@ dashedName: make-dead-links-using-the-hash-symbol
|
||||
|
||||
# --instructions--
|
||||
|
||||
目前,`href` 的属性值是 "`https://freecatphotoapp.com`"。 请将 `href` 属性的值替换为`#`,以此来创建链接占位符。
|
||||
`href` 属性的当前值是指向 “`https://www.freecatphotoapp.com`”。 请将 `href` 属性的值替换为`#`,以此来创建链接占位符。
|
||||
|
||||
例如: `href="#"`
|
||||
|
||||
@ -34,9 +34,9 @@ assert($('a').attr('href') === '#');
|
||||
```html
|
||||
<h2>CatPhotoApp</h2>
|
||||
<main>
|
||||
<p>Click here to view more <a href="https://freecatphotoapp.com" target="_blank">cat photos</a>.</p>
|
||||
<p>Click here to view more <a href="https://www.freecatphotoapp.com" target="_blank">cat photos</a>.</p>
|
||||
|
||||
<img src="https://bit.ly/fcc-relaxing-cat" alt="A cute orange cat lying on its back.">
|
||||
<img src="https://www.bit.ly/fcc-relaxing-cat" alt="A cute orange cat lying on its back.">
|
||||
|
||||
<p>Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
|
||||
<p>Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>
|
||||
@ -50,7 +50,7 @@ assert($('a').attr('href') === '#');
|
||||
<main>
|
||||
<p>Click here to view more <a href="#" target="_blank">cat photos</a>.</p>
|
||||
|
||||
<img src="https://bit.ly/fcc-relaxing-cat" alt="A cute orange cat lying on its back.">
|
||||
<img src="https://www.bit.ly/fcc-relaxing-cat" alt="A cute orange cat lying on its back.">
|
||||
|
||||
<p>Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
|
||||
<p>Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>
|
||||
|
@ -2,7 +2,6 @@
|
||||
id: bad87fee1348bd9aede08817
|
||||
title: 将 a 嵌套在段落中
|
||||
challengeType: 0
|
||||
videoUrl: 'https://scrimba.com/p/pVMPUv/cb6k8Cb'
|
||||
forumTopicId: 18244
|
||||
dashedName: nest-an-anchor-element-within-a-paragraph
|
||||
---
|
||||
@ -13,7 +12,7 @@ dashedName: nest-an-anchor-element-within-a-paragraph
|
||||
|
||||
```html
|
||||
<p>
|
||||
Here's a <a target="_blank" href="http://freecodecamp.org"> link to freecodecamp.org</a> for you to follow.
|
||||
Here's a <a target="_blank" href="https://www.freecodecamp.org"> link to www.freecodecamp.org</a> for you to follow.
|
||||
</p>
|
||||
```
|
||||
|
||||
@ -32,18 +31,18 @@ dashedName: nest-an-anchor-element-within-a-paragraph
|
||||
`target` 是锚点元素的一个属性,它用来指定链接的打开方式。 属性值 `_blank` 表示链接会在新标签页打开。 `href` 是锚点元素的另一个属性,它用来指定链接的 URL:
|
||||
|
||||
```html
|
||||
<a href="http://freecodecamp.org"> ... </a>
|
||||
<a href="https://www.freecodecamp.org" target="_blank"> ... </a>
|
||||
```
|
||||
|
||||
`a` 元素内的文本 `link to freecodecamp.org` 叫作<dfn>锚文本</dfn>,会显示为一个可以点击的链接:
|
||||
`a` 元素内的文本 `link to www.freecodecamp.org` 叫作<dfn>锚文本</dfn>,会显示为一个可以点击的链接:
|
||||
|
||||
```html
|
||||
<a href=" ... ">link to freecodecamp.org</a>
|
||||
<a href=" ... " target="...">link to freecodecamp.org</a>
|
||||
```
|
||||
|
||||
此示例的最终输出结果是这样:
|
||||
|
||||
Here's a [link to freecodecamp.org](http://freecodecamp.org) for you to follow.
|
||||
你可以访问 <a href="https://www.freecodecamp.org" target="_blank">link to www.freecodecamp.org</a>。
|
||||
|
||||
# --instructions--
|
||||
|
||||
@ -59,11 +58,11 @@ assert(
|
||||
);
|
||||
```
|
||||
|
||||
`a` 元素应该链接到 “`https://freecatphotoapp.com`”。
|
||||
`a` 元素应该链接到 “`https://www.freecatphotoapp.com`”。
|
||||
|
||||
```js
|
||||
assert(
|
||||
$('a[href="https://freecatphotoapp.com"]').length === 1
|
||||
$('a[href="https://www.freecatphotoapp.com"]').length === 1
|
||||
);
|
||||
```
|
||||
|
||||
@ -87,7 +86,7 @@ assert($('p') && $('p').length > 2);
|
||||
|
||||
```js
|
||||
assert(
|
||||
$('a[href="https://freecatphotoapp.com"]').parent().is('p')
|
||||
$('a[href="https://www.freecatphotoapp.com"]').parent().is('p')
|
||||
);
|
||||
```
|
||||
|
||||
@ -95,7 +94,7 @@ assert(
|
||||
|
||||
```js
|
||||
assert(
|
||||
$('a[href="https://freecatphotoapp.com"]')
|
||||
$('a[href="https://www.freecatphotoapp.com"]')
|
||||
.parent()
|
||||
.text()
|
||||
.match(/View\smore\s/gi)
|
||||
@ -140,9 +139,9 @@ assert(
|
||||
<h2>CatPhotoApp</h2>
|
||||
<main>
|
||||
|
||||
<a href="https://freecatphotoapp.com" target="_blank">cat photos</a>
|
||||
<a href="https://www.freecatphotoapp.com" target="_blank">cat photos</a>
|
||||
|
||||
<img src="https://bit.ly/fcc-relaxing-cat" alt="A cute orange cat lying on its back.">
|
||||
<img src="https://www.bit.ly/fcc-relaxing-cat" alt="A cute orange cat lying on its back.">
|
||||
|
||||
<p>Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
|
||||
<p>Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>
|
||||
@ -154,9 +153,9 @@ assert(
|
||||
```html
|
||||
<h2>CatPhotoApp</h2>
|
||||
<main>
|
||||
<p>View more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a></p>
|
||||
<p>View more <a target="_blank" href="https://www.freecatphotoapp.com">cat photos</a></p>
|
||||
|
||||
<img src="https://bit.ly/fcc-relaxing-cat" alt="A cute orange cat lying on its back.">
|
||||
<img src="https://www.bit.ly/fcc-relaxing-cat" alt="A cute orange cat lying on its back.">
|
||||
|
||||
<p>Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
|
||||
<p>Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>
|
||||
|
Reference in New Issue
Block a user