2.9 KiB
id, title, challengeType, videoUrl, forumTopicId, dashedName
| id | title | challengeType | videoUrl | forumTopicId | dashedName |
|---|---|---|---|---|---|
| 587d781c367417b2b2512ac2 | Impostare la dimensione del carattere per più elementi di intestazione | 0 | https://scrimba.com/c/cPpQNT3 | 301067 | set-the-font-size-for-multiple-heading-elements |
--description--
La proprietà font-size è usata per specificare quanto grande è il testo in un dato elemento. Questa regola può essere utilizzata per più elementi per creare coerenza visiva del testo in una pagina. In questa sfida, imposterai i valori per tutti i tag da h1 a h6 per bilanciare le dimensioni dell'intestazione.
--instructions--
Nel tag style, imposta la dimensione del font (font-size) per:
- Il tag
h1a 68px. - Il tag
h2a 52px. - Il tag
h3a 40px. - Il tag
h4a 32px. - Il tag
h5a 21px. - Il tag
h6a 14px.
--hints--
Il codice dovrebbe impostare la proprietà font-size per il tag h1 a 68 pixel.
const fontSizeOfh1 = new __helpers.CSSHelp(document).getStyle('h1')?.getPropertyValue('font-size');
assert(fontSizeOfh1 === '68px');
Il codice dovrebbe impostare la proprietà font-size per il tag h2 a 52 pixel.
const fontSizeOfh2 = new __helpers.CSSHelp(document).getStyle('h2')?.getPropertyValue('font-size');
assert(fontSizeOfh2 === '52px');
Il codice dovrebbe impostare la proprietà font-size per il tag h3 a 40 pixel.
const fontSizeOfh3 = new __helpers.CSSHelp(document).getStyle('h3')?.getPropertyValue('font-size');
assert(fontSizeOfh3 === '40px');
Il codice dovrebbe impostare la proprietà font-size per il tag h4 a 32 pixel.
const fontSizeOfh4 = new __helpers.CSSHelp(document).getStyle('h4')?.getPropertyValue('font-size');
assert(fontSizeOfh4 === '32px');
Il codice dovrebbe impostare la proprietà font-size per il tag h5 a 21 pixel.
const fontSizeOfh5 = new __helpers.CSSHelp(document).getStyle('h5')?.getPropertyValue('font-size');
assert(fontSizeOfh5 === '21px');
Il codice dovrebbe impostare la proprietà font-size per il tag h6 a 14 pixel.
const fontSizeOfh6 = new __helpers.CSSHelp(document).getStyle('h6')?.getPropertyValue('font-size');
assert(fontSizeOfh6 === '14px');
--seed--
--seed-contents--
<style>
</style>
<h1>This is h1 text</h1>
<h2>This is h2 text</h2>
<h3>This is h3 text</h3>
<h4>This is h4 text</h4>
<h5>This is h5 text</h5>
<h6>This is h6 text</h6>
--solutions--
<style>
h1 {
font-size: 68px;
}
h2 {
font-size: 52px;
}
h3 {
font-size: 40px;
}
h4 {
font-size: 32px;
}
h5 {
font-size: 21px;
}
h6 {
font-size: 14px;
}
</style>
<h1>This is h1 text</h1>
<h2>This is h2 text</h2>
<h3>This is h3 text</h3>
<h4>This is h4 text</h4>
<h5>This is h5 text</h5>
<h6>This is h6 text</h6>