freeCodeCamp/curriculum/challenges/chinese-traditional/14-responsive-web-design-22/learn-the-css-box-model-by-.../60a3e3396c7b40068ad6996f.md

48 lines
773 B
Markdown
Raw Normal View History

---
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>
```