|
3 | 3 | <head> |
4 | 4 | <meta charset="utf-8" /> |
5 | 5 | <meta http-equiv="X-UA-Compatible" content="IE=edge" /> |
6 | | - <title>My form exercise</title> |
7 | | - <meta name="description" content="" /> |
| 6 | + <title>T-shirt Order Form</title> |
| 7 | + <meta name="description" content="Choose your T-shirt colour and size." /> |
8 | 8 | <meta name="viewport" content="width=device-width, initial-scale=1" /> |
| 9 | + <link rel="stylesheet" href="styles.css" /> |
9 | 10 | </head> |
10 | 11 | <body> |
11 | 12 | <header> |
12 | 13 | <h1>Product Pick</h1> |
13 | 14 | </header> |
| 15 | + |
14 | 16 | <main> |
15 | | - <form> |
16 | | - <!-- write your html here--> |
17 | | - <!-- |
18 | | - try writing out the requirements first as comments |
19 | | - this will also help you fill in your PR message later--> |
| 17 | + <form aria-label="T-shirt order form"> |
| 18 | + <div class="form-group"> |
| 19 | + <label for="name">Name</label> |
| 20 | + <input |
| 21 | + id="name" |
| 22 | + name="name" |
| 23 | + type="text" |
| 24 | + pattern=".*\S.*\S.*" |
| 25 | + title="Please enter at least two non-space characters." |
| 26 | + required |
| 27 | + /> |
| 28 | + </div> |
| 29 | + |
| 30 | + <div class="form-group"> |
| 31 | + <label for="email">Email</label> |
| 32 | + <input |
| 33 | + id="email" |
| 34 | + name="email" |
| 35 | + type="email" |
| 36 | + required |
| 37 | + /> |
| 38 | + </div> |
| 39 | + |
| 40 | + <fieldset class="form-group"> |
| 41 | + <legend>Choose a colour</legend> |
| 42 | + <div class="radio-group"> |
| 43 | + <label class="option" for="colour-red"> |
| 44 | + <input id="colour-red" name="colour" type="radio" value="red" required /> |
| 45 | + <span>Red</span> |
| 46 | + </label> |
| 47 | + |
| 48 | + <label class="option" for="colour-blue"> |
| 49 | + <input id="colour-blue" name="colour" type="radio" value="blue" /> |
| 50 | + <span>Blue</span> |
| 51 | + </label> |
| 52 | + |
| 53 | + <label class="option" for="colour-black"> |
| 54 | + <input id="colour-black" name="colour" type="radio" value="black" /> |
| 55 | + <span>Black</span> |
| 56 | + </label> |
| 57 | + </div> |
| 58 | + </fieldset> |
| 59 | + |
| 60 | + <div class="form-group"> |
| 61 | + <label for="size">Choose a size</label> |
| 62 | + <select id="size" name="size" required> |
| 63 | + <option value="" selected disabled>Select a size</option> |
| 64 | + <option value="XS">XS</option> |
| 65 | + <option value="S">S</option> |
| 66 | + <option value="M">M</option> |
| 67 | + <option value="L">L</option> |
| 68 | + <option value="XL">XL</option> |
| 69 | + <option value="XXL">XXL</option> |
| 70 | + </select> |
| 71 | + </div> |
| 72 | + |
| 73 | + <button type="submit">Order now</button> |
20 | 74 | </form> |
21 | 75 | </main> |
| 76 | + |
22 | 77 | <footer> |
23 | | - <!-- change to your name--> |
24 | | - <p>By HOMEWORK SOLUTION</p> |
| 78 | + <p>By Brian</p> |
25 | 79 | </footer> |
26 | 80 | </body> |
27 | 81 | </html> |
0 commit comments