Skip to content

Commit dd4816e

Browse files
added a new file: Form-Controls/style.css
1 parent e8082bd commit dd4816e

4 files changed

Lines changed: 142 additions & 14 deletions

File tree

Form-Controls/README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,18 @@ Do not write a form action for this project.
3030

3131
Let's write out our testable criteria. Check each one off as you complete it.
3232

33-
- [ ] I have only used HTML and CSS.
34-
- [ ] I have not used any JavaScript.
33+
- [] I have only used HTML and CSS.
34+
- [] I have not used any JavaScript.
3535

3636
### HTML
3737

38-
- [ ] My form is semantic html.
39-
- [ ] All inputs have associated labels.
40-
- [ ] My Lighthouse Accessibility score is 100.
41-
- [ ] I require a valid name. I have defined a valid name as a text string of two characters or more.
42-
- [ ] I require a valid email.
43-
- [ ] I require one colour from a defined set of 3 colours.
44-
- [ ] I require one size from a defined set of 6 sizes.
38+
- [] My form is semantic html.
39+
- [] All inputs have associated labels.
40+
- [] My Lighthouse Accessibility score is 100.
41+
- [] I require a valid name. I have defined a valid name as a text string of two characters or more.
42+
- [] I require a valid email.
43+
- [] I require one colour from a defined set of 3 colours.
44+
- [] I require one size from a defined set of 6 sizes.
4545

4646
## Resources
4747

Form-Controls/index.html

Lines changed: 93 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<meta charset="utf-8" />
55
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
66
<title>My form exercise</title>
7+
<link rel="stylesheet" href="style.css">
78
<meta name="description" content="" />
89
<meta name="viewport" content="width=device-width, initial-scale=1" />
910
</head>
@@ -13,15 +14,102 @@ <h1>Product Pick</h1>
1314
</header>
1415
<main>
1516
<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+
18+
<!--
19+
T-SHIRT ORDER FORM REQUIREMENTS
20+
21+
- Only HTML and CSS (no JavaScript)
22+
- Semantic HTML structure
23+
- All inputs must have associated labels
24+
- Accessibility should be high (Lighthouse target: 100)
25+
26+
DATA TO COLLECT:
27+
28+
1. Customer Name
29+
- Required
30+
- Must be at least 2 characters
31+
32+
2. Customer Email
33+
- Required
34+
- Must be a valid email format
35+
36+
3. T-shirt Colour
37+
- Required
38+
- Must choose ONE from 3 options:
39+
• Black
40+
• White
41+
• Blue
42+
43+
4. T-shirt Size
44+
- Required
45+
- Must choose ONE from 6 options:
46+
• XS
47+
• S
48+
• M
49+
• L
50+
• XL
51+
• XXL
52+
53+
NOTES:
54+
- Do NOT include a form action
55+
- All fields must be required
56+
-->
57+
<!-- Name -->
58+
<label for="name">Name:</label>
59+
<input
60+
type="text"
61+
id="name"
62+
name="name"
63+
minlength="2"
64+
required
65+
>
66+
67+
<br><br>
68+
69+
<!-- Email -->
70+
<label for="email">Email:</label>
71+
<input
72+
type="email"
73+
id="email"
74+
name="email"
75+
required
76+
>
77+
78+
<br><br>
79+
80+
<!-- Colour -->
81+
<label for="colour">Choose Colour:</label>
82+
<select id="colour" name="colour" required>
83+
<option value="">Select Colour</option>
84+
<option value="black">Black</option>
85+
<option value="white">White</option>
86+
<option value="blue">Blue</option>
87+
</select>
88+
89+
<br><br>
90+
91+
<!-- Size -->
92+
<label for="size">Choose Size:</label>
93+
<select id="size" name="size" required>
94+
<option value="">Select Size</option>
95+
<option value="XS">XS</option>
96+
<option value="S">S</option>
97+
<option value="M">M</option>
98+
<option value="L">L</option>
99+
<option value="XL">XL</option>
100+
<option value="XXL">XXL</option>
101+
</select>
102+
103+
<br><br>
104+
105+
<button type="submit">Submit Order</button>
106+
107+
20108
</form>
21109
</main>
22110
<footer>
23111
<!-- change to your name-->
24-
<p>By HOMEWORK SOLUTION</p>
112+
<p>By SHAFIEK WALKER</p>
25113
</footer>
26114
</body>
27115
</html>

Form-Controls/style.css

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
body {
2+
font-family: Arial, sans-serif;
3+
background-color: #f4f4f4;
4+
padding: 40px;
5+
}
6+
7+
h1 {
8+
text-align: center;
9+
}
10+
11+
p {
12+
text-align: center;
13+
}
14+
15+
form {
16+
background-color: white;
17+
max-width: 400px;
18+
margin: 0 auto;
19+
padding: 24px;
20+
border-radius: 12px;
21+
box-shadow: inset 0 0 0 2px #ccc;
22+
}
23+
24+
label {
25+
font-weight: bold;
26+
}
27+
28+
input,
29+
select,
30+
button {
31+
width: 100%;
32+
padding: 10px;
33+
margin-top: 6px;
34+
margin-bottom: 16px;
35+
box-sizing: border-box;
36+
}
37+
38+
button {
39+
cursor: pointer;
40+
}
116 KB
Loading

0 commit comments

Comments
 (0)