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 trialmatteo boni
5,087 Pointshelp me
Add a label element to the select menu with the text "Shirt Color:"
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>HTML Forms</title>
</head>
<body>
<form action="index.html" method="post">
<h1>Shirt Order Form</h1>
<select id="color" name="shirt_color">
<option value="red">red</option>
<option value="yellow">yellow</option>
<option value="blue">blue</option>
<option value="green">green</option>
<option value="color">color</option>
<label for="color">shirt color</label>
</form>
</body>
</html>
4 Answers
Michael Afanasiev
Courses Plus Student 15,596 PointsHey Matteo, your code is fine, just add the label TO the select menu, that means to place the label right above the <select> tag :)
anil rahman
7,786 PointsJust above the select tag so this line:
<select id="color" name="shirt_color">
To create a label you use <label></label> tags Then in the opening tag you use for attribute and link that to the id from the select tag to create a link to the label. Shirt Color is the text between the tags. <label for="color">Shirt Color:</label>
Evans Owino
24,888 PointsAlso the following line might be preventing your from progressing
<option value="color">color</option>
LaToya Legemah
12,600 PointsOne more thing. Make sure you are closing your select statement. I don't see a </select> tag.
matteo boni
5,087 Pointsmatteo boni
5,087 Pointsdon't understand, it's possible write the code :) ? thanks
Michael Afanasiev
Courses Plus Student 15,596 PointsMichael Afanasiev
Courses Plus Student 15,596 PointsSure.
Your code here:
Should be:
anil rahman
7,786 Pointsanil rahman
7,786 Points<form action="index.html" method="post"> <h1>Shirt Order Form</h1> <label for="color">Shirt Color:</label> <!--Added code--> <select id="color" name="shirt_color"> <option value="red">red</option> <option value="yellow">yellow</option> <option value="blue">blue</option> <option value="green">green</option> <option value="color">color</option> </form>