Skip to content

Commit 411591e

Browse files
committed
Update form controls layout and styles
1 parent c44123d commit 411591e

2 files changed

Lines changed: 125 additions & 25 deletions

File tree

Form-Controls/index.html

Lines changed: 70 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,72 @@
11
<!DOCTYPE html>
22
<html lang="en">
3-
<head>
4-
<meta charset="utf-8" />
5-
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
6-
<title>My form exercise</title>
7-
<meta name="description" content="" />
8-
<meta name="viewport" content="width=device-width, initial-scale=1" />
9-
</head>
10-
<body>
11-
<header>
12-
<h1>Product Pick</h1>
13-
</header>
14-
<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-->
20-
</form>
21-
</main>
22-
<footer>
23-
<!-- change to your name-->
24-
<p>By HOMEWORK SOLUTION</p>
25-
</footer>
26-
</body>
27-
</html>
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
7+
<title>T-Shirt Order Form</title>
8+
9+
<meta name="description" content="Order a T-shirt by entering your details and selecting a colour and size.">
10+
<meta name="robots" content="index, follow">
11+
12+
<link rel="stylesheet" href="style.css">
13+
</head>
14+
15+
<body>
16+
17+
<main>
18+
<form>
19+
<h1>T-Shirt Order Form</h1>
20+
21+
<div class="form-group">
22+
<label for="name">Full Name</label>
23+
<input
24+
type="text"
25+
id="name"
26+
name="name"
27+
required
28+
minlength="2"
29+
pattern=".*\S.*"
30+
>
31+
</div>
32+
33+
<div class="form-group">
34+
<label for="email">Email Address</label>
35+
<input
36+
type="email"
37+
id="email"
38+
name="email"
39+
required
40+
>
41+
</div>
42+
43+
<div class="form-group">
44+
<label for="colour">Choose a Colour</label>
45+
<select id="colour" name="colour" required>
46+
<option value="">Select a colour</option>
47+
<option value="black">Black</option>
48+
<option value="white">White</option>
49+
<option value="blue">Blue</option>
50+
</select>
51+
</div>
52+
53+
<div class="form-group">
54+
<label for="size">Choose a Size</label>
55+
<select id="size" name="size" required>
56+
<option value="">Select a size</option>
57+
<option value="XS">XS</option>
58+
<option value="S">S</option>
59+
<option value="M">M</option>
60+
<option value="L">L</option>
61+
<option value="XL">XL</option>
62+
<option value="XXL">XXL</option>
63+
</select>
64+
</div>
65+
66+
<button type="submit">Submit Order</button>
67+
68+
</form>
69+
</main>
70+
71+
</body>
72+
</html>

Form-Controls/style.css

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
* {
2+
box-sizing: border-box;
3+
margin: 0;
4+
padding: 0;
5+
}
6+
7+
body {
8+
font-family: Arial, sans-serif;
9+
background-color: #f4f4f4;
10+
min-height: 100vh;
11+
display: flex;
12+
justify-content: center;
13+
align-items: center;
14+
}
15+
16+
form {
17+
background-color: white;
18+
padding: 30px;
19+
border-radius: 10px;
20+
width: 350px;
21+
}
22+
23+
h1 {
24+
text-align: center;
25+
margin-bottom: 20px;
26+
}
27+
28+
.form-group {
29+
margin-bottom: 15px;
30+
}
31+
32+
label {
33+
display: block;
34+
margin-bottom: 5px;
35+
font-weight: bold;
36+
}
37+
38+
input,
39+
select {
40+
width: 100%;
41+
padding: 10px;
42+
}
43+
44+
button {
45+
width: 100%;
46+
padding: 10px;
47+
border: none;
48+
background-color: black;
49+
color: white;
50+
cursor: pointer;
51+
}
52+
53+
button:hover {
54+
background-color: #333;
55+
}

0 commit comments

Comments
 (0)