Skip to content

Commit 56c0cf5

Browse files
author
russom
committed
Style seprated from html and contained in its own file.
1 parent 2753312 commit 56c0cf5

2 files changed

Lines changed: 79 additions & 3 deletions

File tree

‎Form-Controls/index.html‎

Lines changed: 41 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,48 @@ <h1>Product Pick</h1>
1313
</header>
1414
<main>
1515
<form>
16-
<!-- write your html here-->
17-
<!--
18-
try writing out the requirements first as comments
16+
17+
<div>
18+
19+
<label for="name"> Name:</label>
20+
<input type="text" id="name" name="name" required pattern="\S{2,}" title="Please enter at least two non-space characters.">
21+
</div>
22+
23+
<div>
24+
<label for="email"> Email:</label>
25+
<input type="email" id="email" name="email" required>
26+
</div>
27+
<div>
28+
<label for="color"> Colour:</label>
29+
<select id="color" name="color" required>
30+
<option value="">Please select a colour</option>
31+
<option value="red">Red</option>
32+
<option value="blue">Blue</option>
33+
<option value="green">Green</option>
34+
</select>
35+
</div>
36+
<div>
37+
<label for="size"> Size:</label>
38+
<select id="size" name="size" required>
39+
<option value="">Please select a size</option>
40+
<option value="xs">XS</option>
41+
<option value="s">S</option>
42+
<option value="m">M</option>
43+
<option value="l">L</option>
44+
<option value="xl">XL</option>
45+
<option value="xxl">XXL</option>
46+
</select>
47+
</div>
48+
<div>
49+
<button type="submit">Submit</button>
50+
</div>
51+
<!--
1952
this will also help you fill in your PR message later-->
53+
<!--
54+
What is the customer's name? I must collect this data and ensure it contains at least two non-space characters.
55+
What is the customer's email? I must make sure the email is valid. Email addresses follow a consistent pattern.
56+
What colour should this T-shirt be? I must provide 3 options. How will I ensure they do not choose other colours?
57+
What size does the customer want? I must provide the following 6 options: XS, S, M, L, XL, XXL -->
2058
</form>
2159
</main>
2260
<footer>

‎Form-Controls/style.css‎

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
body {
2+
font-family: Arial, sans-serif;
3+
margin: 0;
4+
padding: 0;
5+
}
6+
header {
7+
color: black;
8+
padding: 1rem;
9+
text-align: center;
10+
margin-bottom: 20px;
11+
}
12+
main {
13+
padding: 1rem;
14+
}
15+
form {
16+
max-width: 400px;
17+
margin: 0 auto;
18+
}
19+
div {
20+
margin-bottom: 1rem;
21+
}
22+
label {
23+
display: block;
24+
margin-bottom: 0.5rem;
25+
}
26+
input,
27+
select {
28+
width: 100%;
29+
padding: 0.5rem;
30+
box-sizing: border-box;
31+
}
32+
button {
33+
padding: 0.5rem 1rem;
34+
background-color: #333;
35+
color: white;
36+
border: none;
37+
cursor: pointer;
38+
}

0 commit comments

Comments
 (0)