1.8 KiB
1.8 KiB
id, title, challengeType, videoUrl, localeTitle
| id | title | challengeType | videoUrl | localeTitle |
|---|---|---|---|---|
| 587d7fa7367417b2b2512bc6 | Add Inline Styling to Elements | 6 | Adicionar estilo inline aos elementos |
Description
style() . O método style() usa um par de valores-chave separados por vírgulas como argumento. Aqui está um exemplo para definir a cor do texto da seleção para azul: selection.style("color","blue"); Instructions
style() ao código no editor para fazer com que todo o texto exibido tenha uma font-family de font-family de verdana . Tests
tests:
- text: Seus elementos <code>h2</code> devem ter uma <code>font-family</code> de <code>font-family</code> de verdana.
testString: 'assert($("h2").css("font-family") == "verdana", "Your <code>h2</code> elements should have a <code>font-family</code> of verdana.");'
- text: Seu código deve usar o método <code>style()</code> .
testString: 'assert(code.match(/\.style/g), "Your code should use the <code>style()</code> method.");'
Challenge Seed
<body>
<script>
const dataset = [12, 31, 22, 17, 25, 18, 29, 14, 9];
d3.select("body").selectAll("h2")
.data(dataset)
.enter()
.append("h2")
.text((d) => (d + " USD"))
// Add your code below this line
// Add your code above this line
</script>
</body>
Solution
// solution required