2.0 KiB
2.0 KiB
id | title | challengeType | dashedName |
---|---|---|---|
5f3477ae9675db8bb7655b30 | Step 12 | 0 | step-12 |
--description--
Nello step precedente, hai usato un selettore di tipo (type selector) per agire sullo stile dell'elemento h1
. Centra gli elementi h2
e p
aggiungendo un nuovo selettore di tipo per ognuno degli elementi style
esistenti.
--hints--
Non dovresti cambiare il selettore h1
esistente.
const hasH1 = new __helpers.CSSHelp(document).getStyle('h1');
assert(hasH1);
Non dovresti aggiungere un nuovo tag style
. Aggiungi le nuove regole CSS al tag style
esistente.
const hasManyStyleTags = document.querySelectorAll('style').length > 1;
assert(!hasManyStyleTags);
Dovresti aggiungere un nuovo selettore h2
.
const hasH2 = new __helpers.CSSHelp(document).getStyle('h2');
assert(hasH2);
Dovresti aggiungere un nuovo selettore p
.
const hasP = new __helpers.CSSHelp(document).getStyle('p');
assert(hasP);
L'elemento h1
dovrebbe avere una proprietà text-align
con valore center
.
const h1TextAlign = new __helpers.CSSHelp(document).getStyle('h1')?.getPropertyValue('text-align');
assert(h1TextAlign === 'center');
L'elemento h2
dovrebbe avere una proprietà text-align
con valore center
.
const h2TextAlign = new __helpers.CSSHelp(document).getStyle('h2')?.getPropertyValue('text-align');
assert(h2TextAlign === 'center');
L'elemento p
dovrebbe avere una proprietà text-align
con valore center
.
const pTextAlign = new __helpers.CSSHelp(document).getStyle('p')?.getPropertyValue('text-align');
assert(pTextAlign === 'center');
--seed--
--seed-contents--
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Cafe Menu</title>
--fcc-editable-region--
<style>
h1 {
text-align: center;
}
</style>
--fcc-editable-region--
</head>
<body>
<main>
<h1>CAMPER CAFE</h1>
<p>Est. 2020</p>
<section>
<h2>Coffee</h2>
</section>
</main>
</body>
</html>