---
id: 62a2409897ec621942234cf6
title: 步骤 9
challengeType: 0
dashedName: step-9
---

# --description--

给 `#text` 元素一个 `black` 的 `background-color`，一个 `white` 的 `color` 和一个 `10px` 的边距。

# --hints--

应该有一个 `#text` 选择器。

```js
const text = new __helpers.CSSHelp(document).getStyle('#text');
assert.exists(text);
```

`#text` 元素应该有一个 `black` 的 `background-color`。

```js
const background = new __helpers.CSSHelp(document).getStyle('#text')?.getPropertyValue('background-color');
assert.equal(background, 'black');
```

`#text` 元素应该具有 `white` 的 `color`。

```js
const color = new __helpers.CSSHelp(document).getStyle('#text')?.getPropertyValue('color');
assert.equal(color, 'white');
```

`#text` 元素应该有 `10px` 的边距。

```js
const padding = new __helpers.CSSHelp(document).getStyle('#text')?.getPropertyValue('padding');
assert.equal(padding, '10px');
```

# --seed--

## --seed-contents--

```html
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <link rel="stylesheet" href="./styles.css">
    <title>RPG - Dragon Repeller</title>
</head>
<body>
    <div id="game">
        <div id="stats">
            <span class="stat">XP: <strong><span id="xpText">0</span></strong></span>
            <span class="stat">Health: <strong><span id="healthText">100</span></strong></span>
            <span class="stat">Gold: <strong><span id="goldText">50</span></strong></span>
        </div>
        <div id="controls">
            <button id="button1">Go to store</button>
            <button id="button2">Go to cave</button>
            <button id="button3">Fight dragon</button>
        </div>
        <div id="monsterStats">
            <span class="stat">Monster Name: <strong><span id="monsterName"></span></strong></span>
            <span class="stat">Health: <strong><span id="monsterHealth"></span></strong></span>
        </div>
        <div id="text">
            Welcome to Dragon Repeller. You must defeat the dragon that is preventing people from leaving the town. You are in the town square. Where do you want to go? Use the buttons above.
        </div>
    </div>
</body>
</html>
```

```css
body {
    background-color: darkblue;
}

--fcc-editable-region--

--fcc-editable-region--
```
