--- id: bad87fee1348bd9aedf08746 title: Inherit Styles from the Body Element challengeType: 0 videoUrl: '' localeTitle: Heredar estilos del elemento cuerpo --- ## Descripción
Ahora hemos comprobado que cada página HTML tiene un elemento de body y que su elemento de body también se puede diseñar con CSS. Recuerde, puede diseñar su elemento de body como cualquier otro elemento HTML, y todos los demás elementos heredarán los estilos de su elemento de body .
## Instrucciones
Primero, cree un elemento h1 con el texto Hello World Then, vamos a dar a todos los elementos de su página el color green agregando color: green; a la declaración de estilo de tu elemento body . Finalmente, asigne a su elemento body la familia de fuentes de monospace agregando font-family: monospace; a la declaración de estilo de tu elemento body .
## Pruebas
```yml tests: - text: Crear un elemento h1 . testString: 'assert(($("h1").length > 0), "Create an h1 element.");' - text: Tu elemento h1 debería tener el texto Hello World . testString: 'assert(($("h1").length > 0 && $("h1").text().match(/hello world/i)), "Your h1 element should have the text Hello World.");' - text: Asegúrese de que su elemento h1 tenga una etiqueta de cierre. testString: 'assert(code.match(/<\/h1>/g) && code.match(/

/g).length === code.match(/

h1 element has a closing tag.");' - text: Dale a tu body elemento del color la propiedad de green . testString: 'assert(($("body").css("color") === "rgb(0, 128, 0)"), "Give your body element the color property of green.");' - text: Dale a tu elemento del body la propiedad font-family de monospace . testString: 'assert(($("body").css("font-family").match(/monospace/i)), "Give your body element the font-family property of monospace.");' - text: Su elemento h1 debería heredar la fuente monospace de su elemento de body . testString: 'assert(($("h1").length > 0 && $("h1").css("font-family").match(/monospace/i)), "Your h1 element should inherit the font monospace from your body element.");' - text: Su elemento h1 debe heredar el color verde de su elemento de body . testString: 'assert(($("h1").length > 0 && $("h1").css("color") === "rgb(0, 128, 0)"), "Your h1 element should inherit the color green from your body element.");' ```

## Challenge Seed
```html ```
## Solución
```js // solution required ```