freeCodeCamp/curriculum/challenges/chinese-traditional/14-responsive-web-design-22/learn-intermediate-css-by-b.../60b69a66b6ddb80858c51583.md

85 lines
1.8 KiB
Markdown

---
id: 60b69a66b6ddb80858c51583
title: 步驟 13
challengeType: 0
dashedName: step-13
---
# --description--
`offwhite-character` 元素內創建四個 `div` 元素。 按順序爲這些 `div` 元素提供以下 `id` 值:`white-hat`、`black-mask`、`gray-instrument`、`tan-table`。
# --hints--
應該在 `.offwhite-character` 元素中添加四個 `div` 元素。
```js
assert(document.querySelectorAll('#offwhite-character div').length === 4);
```
第一個新 `div` 元素應該具有 `white-hat``id`
```js
assert(document.querySelectorAll('#offwhite-character div')[0]?.getAttribute('id') === 'white-hat');
```
第二個新 `div` 元素應具有 `black-mask``id`
```js
assert(document.querySelectorAll('#offwhite-character div')[1]?.getAttribute('id') === 'black-mask');
```
第三個新 `div` 元素應該具有 `gray-instrument``id`
```js
assert(document.querySelectorAll('#offwhite-character div')[2]?.getAttribute('id') === 'gray-instrument');
```
第四個新 `div` 元素應該具有 `tan-table``id`
```js
assert(document.querySelectorAll('#offwhite-character div')[3]?.getAttribute('id') === 'tan-table');
```
# --seed--
## --seed-contents--
```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Picasso Painting</title>
<link rel="stylesheet" href="./styles.css" />
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.2/css/all.css">
</head>
<body>
<div id="back-wall"></div>
<div class="characters">
<div id="offwhite-character">
--fcc-editable-region--
--fcc-editable-region--
</div>
</div>
</body>
</html>
```
```css
body {
background-color: rgb(184, 132, 46);
}
#back-wall {
background-color: #8B4513;
width: 100%;
height: 60%;
position: absolute;
top: 0;
left: 0;
z-index: -1;
}
```