# What is wrong with my code? I don't understand

**URL:** <https://forum.freecodecamp.org/t/what-is-wrong-with-my-code-i-dont-understand/491151>\
**Category:** Curriculum Help\
**Tags:** html, css\
**Created:** [January 4, 2022, 9:22pm UTC](https://forum.freecodecamp.org/t/what-is-wrong-with-my-code-i-dont-understand/491151 "2022-01-04T21:22:50Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Llpic](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/llpic/32/244143_2.png) [@Llpic](https://forum.freecodecamp.org/u/Llpic)\
**Post date:** [January 4, 2022, 9:22pm UTC](https://forum.freecodecamp.org/t/what-is-wrong-with-my-code-i-dont-understand/491151/1 "2022-01-04T21:22:50Z")

</div>

This is whats it is saying The existing

```auto
input

```

element should be nested within a

```auto
form

```

element. Your

```auto
form

```

element should have well-formed open and close tags.

```
  **Your code so far**

```

```html

<h2>CatPhotoApp</h2>
<main>
<p>Click here to view more <a href="#">cat photos</a>.</p>

<a href="#"><img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" alt="A cute orange cat lying on its back."></a>

<p>Things cats love:</p>
<ul>
  <li>cat nip</li>
  <li>laser pointers</li>
  <li>lasagna</li>
</ul>
<p>Top 3 things cats hate:</p>
<ol>
  <li>flea treatment</li>
  <li>thunder</li>
  <li>other cats</li>
</ol>
<input type="text" placeholder="cat photo URL">
<form action= "https://www.freecatphotoapp.com/submit-cat-photo"
<input>
</form> 
</main>

```

```
  **Your browser information:**

```

User Agent is: `Mozilla/5.0 (X11; CrOS x86_64 14268.67.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.111 Safari/537.36`

**Challenge:** Create a Form Element

**Link to the challenge:**

> **[freeCodeCamp.org](https://www.freecodecamp.org/learn/responsive-web-design/basic-html-and-html5/create-a-form-element)**
>
> Learn to Code — For Free

---

<div class="post-metadata">

**Author:** ![JeremyLT](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/jeremylt/32/291894_2.png) [@JeremyLT](https://forum.freecodecamp.org/u/JeremyLT)\
**Post date:** [January 4, 2022, 9:34pm UTC](https://forum.freecodecamp.org/t/what-is-wrong-with-my-code-i-dont-understand/491151/2 "2022-01-04T21:34:32Z")

</div>

> [@Llpic](#):
>
> ```auto
> <input type="text" placeholder="cat photo URL">
> <form action= "https://www.freecatphotoapp.com/submit-cat-photo"
> 
> ```

It looks like your input is _above_ your form.

> [@Llpic](#):
>
> `<input>`

Also you made a new, empty input element here. You shouldn’t be making a new input element.

---

<div class="post-metadata">

**Author:** ![Roma](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/roma/32/112899_2.png) [@Roma](https://forum.freecodecamp.org/u/Roma)\
**Post date:** [January 4, 2022, 9:35pm UTC](https://forum.freecodecamp.org/t/what-is-wrong-with-my-code-i-dont-understand/491151/3 "2022-01-04T21:35:35Z")

</div>

You did not nest the existing `input` element. Rather you left it outside of the `form` element you created and put in blank `input`.

Nesting was first touched on in [this lesson](https://www.freecodecamp.org/learn/responsive-web-design/basic-html-and-html5/nest-an-anchor-element-within-a-paragraph)

Here’s an example of a nested element

```auto
<outerElement class="parent">
  <nestedElement class="child"> 
  </nestedElement>
</outerElement>

```

---

<div class="post-metadata">

**Author:** ![lizz.garleb](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/lizz.garleb/32/243637_2.png) [@lizz.garleb](https://forum.freecodecamp.org/u/lizz.garleb)\
**Post date:** [January 4, 2022, 9:35pm UTC](https://forum.freecodecamp.org/t/what-is-wrong-with-my-code-i-dont-understand/491151/4 "2022-01-04T21:35:35Z")

</div>

> [@Llpic](#):
>
> `action= "h`

This space should not go.

> [@Llpic](#):
>
> `<input type="text" placeholder="cat photo URL">`

This goes after the form area.

Example:

```auto
mod redacted solution

```

---

<div class="post-metadata">

**Author:** ![Roma](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/roma/32/112899_2.png) [@Roma](https://forum.freecodecamp.org/u/Roma)\
**Post date:** [January 4, 2022, 9:36pm UTC](https://forum.freecodecamp.org/t/what-is-wrong-with-my-code-i-dont-understand/491151/5 "2022-01-04T21:36:35Z")

</div>

@lizz.garleb

It is great that you solved the challenge, but instead of posting your full working solution, it is best to stay focused on answering the original poster’s question(s) and help guide them with hints and suggestions to solve their own issues with the challenge.

We are trying to cut back on the number of spoiler solutions found on the forum and instead focus on helping other campers with their questions and definitely not posting full working solutions.

You can post solutions that invite discussion (like asking how the solution works, or asking about certain parts of the solution). But please don’t just post your solution for the sake of sharing it.  
If you post a full passing solution to a challenge and have questions about it, please surround it with `[spoiler]` and `[/spoiler]` tags on the line above and below your solution code.

---

<div class="post-metadata">

**Author:** ![MoAbdu](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/moabdu/32/189482_2.png) [@MoAbdu](https://forum.freecodecamp.org/u/MoAbdu)\
**Post date:** [January 4, 2022, 10:02pm UTC](https://forum.freecodecamp.org/t/what-is-wrong-with-my-code-i-dont-understand/491151/6 "2022-01-04T22:02:15Z")

</div>

> [@Llpic](#):
>
> ```auto
> <form action= "https://www.freecatphotoapp.com/submit-cat-photo"
> <input>
> </form> 
> 
> ```

\<form action= "https://www.freecatphotoapp.com/submit-cat-photo" you forgot to close your form opener tag after the action with this (\>)

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/freecodecamp/original/3X/e/1/e1c433102e34b46dfaa3e15d13ab9a514b127078.svg) [@system](https://forum.freecodecamp.org/u/system)\
**Post date:** [July 6, 2022, 10:03am UTC](https://forum.freecodecamp.org/t/what-is-wrong-with-my-code-i-dont-understand/491151/7 "2022-07-06T10:03:13Z")

</div>

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.
