Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 68 additions & 24 deletions Form-Controls/index.html
Original file line number Diff line number Diff line change
@@ -1,27 +1,71 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>My form exercise</title>
<meta name="description" content="" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
</head>
<body>
<header>
<h1>Product Pick</h1>
</header>
<main>
<form>
<!-- write your html here-->
<!--
try writing out the requirements first as comments
this will also help you fill in your PR message later-->
</form>
</main>
<footer>
<!-- change to your name-->
<p>By HOMEWORK SOLUTION</p>
</footer>
</body>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>T-Shirt Order Form</title>

<!-- Link to CSS file -->
<link rel="stylesheet" href="style.css">
</head>

<body>
<main>
<h1>T-Shirt Order Form</h1>

<form>
<!-- Customer Name -->
<div>
<label for="name">Customer Name</label>
<input
type="text"
id="name"
name="name"
pattern=".*\S.*\S.*"
title="Please enter at least 2 characters (name must contain at least 2 non-space characters)"
required
>
</div>

<!-- Email -->
<div>
<label for="email">Email Address</label>
<input
type="email"
id="email"
name="email"
title="Please enter a valid email address (e.g., name@example.com)"
required
>
</div>

<!-- Colour -->
<div>
<label for="colour">Choose a Colour</label>
<select id="colour" name="colour" title="Please select a colour from the list" required>
<option value="">Select a colour</option>
<option value="black">Black</option>
<option value="white">White</option>
<option value="blue">Blue</option>
</select>
</div>

<!-- Size -->
<div>
<label for="size">Choose a Size</label>
<select id="size" name="size" title="Please select a size from the list" required>
<option value="">Select a size</option>
<option value="XS">XS</option>
<option value="S">S</option>
<option value="M">M</option>
<option value="L">L</option>
<option value="XL">XL</option>
<option value="XXL">XXL</option>
</select>
</div>

<button type="submit">Order T-Shirt</button>
</form>
</main>
</body>
</html>
34 changes: 34 additions & 0 deletions Form-Controls/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
body {
font-family: Arial, sans-serif;
max-width: 600px;
margin: 40px auto;
padding: 20px;
}

h1 {
text-align: center;
}

form {
display: flex;
flex-direction: column;
gap: 16px;
}

label {
display: block;
margin-bottom: 5px;
font-weight: bold;
}

input,
select,
button {
width: 100%;
padding: 10px;
box-sizing: border-box;
}

button {
cursor: pointer;
}
Loading