Back to Freecodecamp

Step 7

curriculum/challenges/english/blocks/learn-basic-css-by-building-a-cafe-menu/5f332b23c2045fb843337579.md

latest1022 B
Original Source

--description--

To let visitors know the cafe was founded in 2020, add a p element below the h1 element with the text Est. 2020.

--hints--

You should have an opening <p> tag.

js
assert(code.match(/<p>/i));

You should have a closing </p> tag.

js
assert(code.match(/<\/p>/i));

You should not change your existing h1 element. Make sure you did not delete the closing tag.

js
assert.lengthOf(document.querySelectorAll('h1'),1);

Your p element should be below your h1 element.

js
assert.equal(document.querySelector('p')?.previousElementSibling?.tagName, 'H1');

Your p element should have the text Est. 2020.

js
assert(document.querySelector("p").innerText === "Est. 2020");

--seed--

--seed-contents--

html
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <title>Cafe Menu</title>
  </head>
  <body>
    <main>
--fcc-editable-region--
      <h1>CAMPER CAFE</h1>
--fcc-editable-region--
    </main>
  </body>
</html>