Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

HTML

Can anyone tell me the html for this input form?

3 Answers

Hi Andrewg,

This would be the basic idea:

<form action="#">
  <input type="text" name="name" id="name" placeholder="name" />
  <input type="text" name="email" id="email" placeholder="email" />
  <input type="submit" value="Submit" />
</form> 

You should also consider having labels with each input rather than relying on the placeholder text as a label.

Treehouse recently launched an html forms course that you may want to check out: http://teamtreehouse.com/library/html-forms

Thank you so much!! I'll check out that course!

You're welcome.

I haven't been through it myself so I don't know how much it goes into this.

If you're against having separate labels next to the inputs then you could also look at the float label pattern

This gives you a way to have both the label and placeholder text and still conserve screen space.

I wanted to know how to put 'name' and 'email' inside of the forms as shown in the picture. I couldn't figure out how and couldn't find anywhere online as to how to do that. The lesson in which they came from didn't explain it either.

<form>
First name: <input type="text" name="firstname" value="name"><br>
Last name: <input type="text" name="lastname" value="lastname">
</form>