---
id: 587d7faa367417b2b2512bd3
title: Style D3 Labels
challengeType: 6
videoUrl: ''
localeTitle: 风格D3标签
---
## Description
D3方法可以为条形标签添加样式。 fill
属性设置text
节点的文本颜色。 style()
方法为其他样式设置CSS规则,例如“font-family”或“font-size”。
## Instructions
将text
元素的font-size
设置为25px,将文本颜色设置为红色。
## Tests
```yml
tests:
- text: 标签应该都具有红色的fill
颜色。
testString: 'assert($("text").css("fill") == "rgb(255, 0, 0)", "The labels should all have a fill
color of red.");'
- text: 标签应该都具有25像素的font-size
。
testString: 'assert($("text").css("font-size") == "25px", "The labels should all have a font-size
of 25 pixels.");'
```
## Challenge Seed
## Solution
```js
// solution required
```