Files
freeCodeCamp/curriculum/challenges/english/01-responsive-web-design/basic-html-cat-photo-app/part-007.md
Oliver Eyton-Williams ee1e8abd87 feat(curriculum): restore seed + solution to Chinese (#40683)
* feat(tools): add seed/solution restore script

* chore(curriculum): remove empty sections' markers

* chore(curriculum): add seed + solution to Chinese

* chore: remove old formatter

* fix: update getChallenges

parse translated challenges separately, without reference to the source

* chore(curriculum): add dashedName to English

* chore(curriculum): add dashedName to Chinese

* refactor: remove unused challenge property 'name'

* fix: relax dashedName requirement

* fix: stray tag

Remove stray `pre` tag from challenge file.

Signed-off-by: nhcarrigan <nhcarrigan@gmail.com>

Co-authored-by: nhcarrigan <nhcarrigan@gmail.com>
2021-01-12 19:31:00 -07:00

62 lines
1.4 KiB
Markdown

---
id: 5dc23f9bf86c76b9248c6eba
title: Part 7
challengeType: 0
dashedName: part-7
---
# --description--
You can add images to your website by using the `img` element. `img` elements have an opening tag without a closing tag. A tag for an element without a closing tag is known as a <dfn>self-closing tag</dfn>.
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>`.
```js
assert(document.querySelector('img'));
```
Your `img` element should not have a closing tag. Closing tags have a `/` just after the `<` character.
```js
assert(!code.match(/<\/img\>/));
```
You should only have one `img` element. Remove any extras.
```js
assert(document.querySelectorAll('img').length === 1);
```
Your `img` element should be below the `p` element. You have them in the wrong order.
```js
const collection = [...document.querySelectorAll('p,img')].map(
(node) => node.nodeName
);
assert(collection.indexOf('P') < collection.indexOf('IMG'));
```
# --seed--
## --seed-contents--
```html
<html>
<body>
<h1>CatPhotoApp</h1>
<main>
<h2>Cat Photos</h2>
<!-- TODO: Add link to cat photos -->
--fcc-editable-region--
<p>Click here to view more cat photos.</p>
--fcc-editable-region--
</main>
</body>
</html>
```