Skip to content

Commit 40c3185

Browse files
author
russom
committed
Lables and input and css created
1 parent a7b8a25 commit 40c3185

1 file changed

Lines changed: 83 additions & 4 deletions

File tree

Form-Controls/index.html

Lines changed: 83 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,101 @@
66
<title>My form exercise</title>
77
<meta name="description" content="" />
88
<meta name="viewport" content="width=device-width, initial-scale=1" />
9+
<style>
10+
body {
11+
font-family: Arial, sans-serif;
12+
margin: 0;
13+
padding: 0;
14+
}
15+
header {
16+
color: black;
17+
padding: 1rem;
18+
text-align: center;
19+
margin-bottom: 20px;
20+
}
21+
main {
22+
padding: 1rem;
23+
}
24+
form {
25+
max-width: 400px;
26+
margin: 0 auto;
27+
}
28+
div {
29+
margin-bottom: 1rem;
30+
}
31+
label {
32+
display: block;
33+
margin-bottom: 0.5rem;
34+
}
35+
input,
36+
select {
37+
width: 100%;
38+
padding: 0.5rem;
39+
box-sizing: border-box;
40+
}
41+
button {
42+
padding: 0.5rem 1rem;
43+
background-color: #333;
44+
color: white;
45+
border: none;
46+
cursor: pointer;
47+
}
48+
49+
</style>
950
</head>
1051
<body>
1152
<header>
1253
<h1>Product Pick</h1>
1354
</header>
1455
<main>
1556
<form>
16-
<!-- write your html here-->
17-
<!--
18-
try writing out the requirements first as comments
57+
58+
<div>
59+
60+
<label for="name"> Name:</label>
61+
<input type="text" id="name" name="name" required pattern="\S{2,}" title="Please enter at least two non-space characters.">
62+
</div>
63+
64+
<div>
65+
<label for="email"> Email:</label>
66+
<input type="email" id="email" name="email" required>
67+
</div>
68+
<div>
69+
<label for="color"> Colour:</label>
70+
<select id="color" name="color" required>
71+
<option value="">Please select a colour</option>
72+
<option value="red">Red</option>
73+
<option value="blue">Blue</option>
74+
<option value="green">Green</option>
75+
</select>
76+
</div>
77+
<div>
78+
<label for="size"> Size:</label>
79+
<select id="size" name="size" required>
80+
<option value="">Please select a size</option>
81+
<option value="xs">XS</option>
82+
<option value="s">S</option>
83+
<option value="m">M</option>
84+
<option value="l">L</option>
85+
<option value="xl">XL</option>
86+
<option value="xxl">XXL</option>
87+
</select>
88+
</div>
89+
<div>
90+
<button type="submit">Submit</button>
91+
</div>
92+
<!--
1993
this will also help you fill in your PR message later-->
94+
<!--
95+
What is the customer's name? I must collect this data and ensure it contains at least two non-space characters.
96+
What is the customer's email? I must make sure the email is valid. Email addresses follow a consistent pattern.
97+
What colour should this T-shirt be? I must provide 3 options. How will I ensure they do not choose other colours?
98+
What size does the customer want? I must provide the following 6 options: XS, S, M, L, XL, XXL -->
2099
</form>
21100
</main>
22101
<footer>
23102
<!-- change to your name-->
24-
<p>By HOMEWORK SOLUTION</p>
103+
<p>By Russom G</p>
25104
</footer>
26105
</body>
27106
</html>

0 commit comments

Comments
 (0)