Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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>