mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2025-12-19 18:18:27 -05:00
Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com> Co-authored-by: Dario-DC <105294544+Dario-DC@users.noreply.github.com> Co-authored-by: Mrugesh Mohapatra <1884376+raisedadead@users.noreply.github.com>
1.3 KiB
1.3 KiB
id, title, challengeType, dashedName
| id | title | challengeType | dashedName |
|---|---|---|---|
| 5dc23f9bf86c76b9248c6eba | Step 7 | 0 | step-7 |
--description--
You can add images to your website by using the img element. img elements have an opening tag without a closing tag. An element without a closing tag is known as a void element.
Add an img element below the p element. At this point, no image will show up in the browser.
--hints--
Your img element should have an opening tag. Opening tags have this syntax: <elementName>.
assert(document.querySelector('img'));
Your img element should not have a closing tag </img>.
assert(!code.match(/<\/img\>/));
You should only have one img element. Remove any extras.
assert(document.querySelectorAll('img').length === 1);
Your img element should be below the p element. You have them in the wrong order.
const collection = [...document.querySelectorAll('p,img')].map(
(node) => node.nodeName
);
assert(collection.indexOf('P') < collection.indexOf('IMG'));
--seed--
--seed-contents--
<html>
<body>
<main>
<h1>CatPhotoApp</h1>
<h2>Cat Photos</h2>
<!-- TODO: Add link to cat photos -->
--fcc-editable-region--
<p>Everyone loves cute cats online!</p>
--fcc-editable-region--
</main>
</body>
</html>