Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
8ce5a1a
creating form Fist name inpute element
Tobias-Amaechina May 20, 2026
6f1279a
created form last name inpute element
Tobias-Amaechina May 20, 2026
7d5b6cd
created email inpute element
Tobias-Amaechina May 20, 2026
c0d5aa2
replace non-semantic div with semantic section tags
Tobias-Amaechina May 20, 2026
c93d2a7
Created password input element
Tobias-Amaechina May 20, 2026
2587fb8
creating color input element and Size input element
Tobias-Amaechina May 20, 2026
7b3e78e
writing the requirements and the foot note update
Tobias-Amaechina May 20, 2026
790019b
fixing the closing '<code></select></code>' tag at line 65 and chang…
Tobias-Amaechina May 20, 2026
3202a19
removed the cosing tag from the input element of first-name, last-na…
Tobias-Amaechina May 20, 2026
ec3f16d
fix the submitt syntax with the right tags
Tobias-Amaechina May 20, 2026
5e7ec28
adding legend to the shirt color
Tobias-Amaechina May 20, 2026
919fac9
adding CSS internal style at the head section for the HTml elements
Tobias-Amaechina May 20, 2026
3a0d7f9
formatted the lines of code for readability and consistency
Tobias-Amaechina May 27, 2026
f9815d2
close the speaces between the Html attributes and it's values
Tobias-Amaechina May 27, 2026
575e5a3
changed the boarder attribute value from none to red solid and fore…
Tobias-Amaechina May 27, 2026
599a456
separated the CSS from HTML
Tobias-Amaechina Jun 5, 2026
4efc9b0
deleted the style rule in the head section after separation and link…
Tobias-Amaechina Jun 5, 2026
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
75 changes: 72 additions & 3 deletions Form-Controls/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,91 @@
<title>My form exercise</title>
<meta name="description" content="" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" href="style.css" />
</head>
<body>
<header>
<h1>Product Pick</h1>
</header>
<main>
<form>
<!-- write your html here-->
<!--
<!-- First name-->
<fieldset>
<label for ="first-name">First Name</label>
<input type="text" id="first-name"
name="first-name" required pattern=".*\S.*\S.*"
aria-describedby="fnameHelp">
<small id="fnameHelp">Must be at least 2 characters long</small>
</fieldset>
<!-- Last name-->
<fieldset>
<label for ="last-name">Last Name</label>
<input type="text" id="last-name"
name="last-name" required pattern=".*\S.*\S.*"
aria-describedby="lnameHelp">
<small id="lnameHelp">Must be at least 2 characters long</small>
</fieldset>
<!-- Email-->
<fieldset>
<label for ="email">Email</label>
<input type="email" id="email"
name="email" required pattern="[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,}$"
aria-describedby="emailHelp">
<small id="emailHelp">Must be a valid email address</small>
</fieldset>
<!-- Password-->
<fieldset>
<label for ="password">Password</label>
<input type="password" id="password" name="password"
required pattern="^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,}$"
aria-describedby="passwordHelp">
<small id="passwordHelp">
Must be at least 8 characters long and include at least one uppercase letter,
one lowercase letter,
one number, and one special character</small>
</fieldset>
Comment on lines +43 to +51
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The formatting standard for HTML elements is to use indentation on children elements. This makes it easier to understand the structure. How can you ensure consistent formatting in your code automatically?

<!--Shirt Color-->
<fieldset>
<legend>Shirt Color</legend>
<label for = "shirt-color">Shirt Color</label>
<select id="shirt-color" name="shirt-color" required>
<option value="">Select a color</option>
<option value="red">Red</option>
<option value="blue">Blue</option>
<option value="green">Green</option>
</select>
</fieldset>
<!---Shirt Size-->
<fieldset>
<label for ="shirt-size">Shirt Size</label>
<select id="shirt-size" name="shirt-size" 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>
</fieldset>

<!--Submit button-->
<fieldset>
<button type="submit">Submit Form </button>
</fieldset>

<!--
What is the customer's name? I must collect this data and ensure it contains at least two non-space characters.
What is the customer's email? I must make sure the email is valid. Email addresses follow a consistent pattern.
What colour should this T-shirt be? I must provide 3 options. How will I ensure they do not choose other colours?
What size does the customer want? I must provide the following 6 options: XS, S, M, L, XL, XXL
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>
<p>By Tobias Amaechina</p>
</footer>
</body>
</html>
59 changes: 59 additions & 0 deletions Form-Controls/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
body {
font-family: system-ui, sans-serif;
padding: 1rem;
line-height: 1.5;
}

form {
max-width: 500px;
margin: auto;
}

fieldset {
border: none;
padding: 0;
margin: 1.5rem;
}

label {
display: block;
margin-bottom: 0.5rem;
font-weight: 600;
}

input, select, button {
width: 100%;
padding: 12px;
font-size: 1rem;
min-height: 48px;
box-sizing: border-box;
}

small {
display: block;
margin-top: 0.25rem;
color: #666;
}

button {
padding: 0.75rem 1.5rem;
font-size: 1rem;
background-color: #007BFF;
color: white;
border: none;
cursor: pointer;
}

button:hover {
background-color: #0056b3;
}

header, footer {
text-align: center;
margin-bottom: 2rem;
}

footer p {
font-size: 0.875rem;
color: #666;
}
Loading