48 lines
773 B
Markdown
48 lines
773 B
Markdown
---
|
|
id: 60a3e3396c7b40068ad6996f
|
|
title: 步驟 6
|
|
challengeType: 0
|
|
dashedName: step-6
|
|
---
|
|
|
|
# --description--
|
|
|
|
在 `body` 中添加一個 `div` 元素。
|
|
|
|
將 `class` 屬性設置爲等於 `canvas`。 例如,`<div class="my-div">`。
|
|
|
|
這將作爲你繪畫的畫布。
|
|
|
|
# --hints--
|
|
|
|
代碼應該有一個 `div` 元素。
|
|
|
|
```js
|
|
assert(document.querySelectorAll('div').length === 1)
|
|
```
|
|
|
|
`div` 元素應該有一個 `class`,其值爲 `canvas`。
|
|
|
|
```js
|
|
assert(document.querySelector('div').className.split(' ').includes('canvas'))
|
|
```
|
|
|
|
# --seed--
|
|
|
|
## --seed-contents--
|
|
|
|
```html
|
|
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title>Rothko Painting</title>
|
|
</head>
|
|
<body>
|
|
--fcc-editable-region--
|
|
|
|
--fcc-editable-region--
|
|
</body>
|
|
</html>
|
|
```
|