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