Skip to content

Commit eb0f206

Browse files
committed
html and css - form added
1 parent a4ff50d commit eb0f206

File tree

2 files changed

+95
-4
lines changed

2 files changed

+95
-4
lines changed

Form-Controls/index.html

Lines changed: 68 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,74 @@
1313
<h1>Product Pick</h1>
1414
</header>
1515
<main>
16-
<form>
17-
<!-- write your html here-->
18-
<!-- try writing out the requirements first-->
19-
</form>
16+
<form>
17+
<!-- <p>
18+
<fieldset>
19+
<legend>Do you have a driver's license?<span aria-label="required">*</span></legend>
20+
<input type="radio" required name="driver" id="r1" value="yes"><label for="r1">Yes</label>
21+
<input type="radio" required name="driver" id="r2" value="no"><label for="r2">No</label>
22+
</fieldset>
23+
</p> -->
24+
25+
<!-- <p>
26+
<label for="n1">How old are you?</label>
27+
<input type="number" min="12" max="120" step="1" id="n1" name="age"
28+
pattern="\d+">
29+
</p> -->
30+
31+
<p>
32+
<label for="n1">What is your name?</label>
33+
<input type="text" required pattern="[A-Za-z]+" name="name">
34+
</p>
35+
36+
<p>
37+
<label for="n2">What's your e-mail address?</label>
38+
<input type="email" id="n2" name="email">
39+
</p>
40+
41+
<p>
42+
<label for="t1">Choose your T-shirt color<span aria-label="required">*</span></label>
43+
<!-- <input type="text" id="t1" name="fruit" list="l1" required > -->
44+
<select id="l1" required>
45+
<option value="" disabled selected></option>
46+
<option value="yellow" disabled>yellow</option>
47+
<option value="blue">blue</option>
48+
<option value="red">red</option>
49+
<option value="black" disabled>black</option>
50+
<option value="yellow">yellow</option>
51+
</select>
52+
</p>
53+
54+
<p>
55+
<label for="t2">Choose your size<span aria-label="required">*</span></label>
56+
<!-- <input type="text" id="t1" name="fruit" list="l1" required > -->
57+
<select id="l2" required>
58+
<option value="xs">XS</option>
59+
<option value="s">S</option>
60+
<option value="m">M</option>
61+
<option value="l">L</option>
62+
<option value="xl">XL</option>
63+
<option value="xxl">XXL</option>
64+
</select>
65+
</p>
66+
67+
<p>
68+
<label for="t3">Choose your delivery date</label>
69+
70+
<input type="date" id="t3" min="2022-11-09" max="2022-12-09" />
71+
<small>Slot should be in next four weeks</small>
72+
</p>
73+
74+
75+
<!-- <p>
76+
<label for="t3">Leave a short message</label>
77+
<textarea id="t3" name="msg" maxlength="140" rows="5"></textarea>
78+
</p> -->
79+
<p>
80+
<button>Submit</button>
81+
</p>
82+
</form>
83+
2084

2185
</main>
2286
<footer>

Form-Controls/styles.css

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
form {
2+
font: 1em sans-serif;
3+
max-width: 320px;
4+
}
5+
6+
p > label {
7+
display: block;
8+
}
9+
10+
input[type="text"],
11+
input[type="email"],
12+
input[type="number"],
13+
textarea,
14+
fieldset {
15+
width: 100%;
16+
border: 1px solid #333;
17+
box-sizing: border-box;
18+
}
19+
20+
/* input:invalid {
21+
box-shadow: 0 0 5px 1px rgb(17, 157, 208);
22+
}
23+
24+
input:focus:invalid {
25+
box-shadow: none;
26+
}
27+
*/

0 commit comments

Comments
 (0)