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
35 changes: 35 additions & 0 deletions Form-Controls/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
body {
font-family: Arial, sans-serif;
padding: 20px;
background-color: Pink;
}
h2 {
text-align: center;
}

.form-group {
width: 60%;
background: white;
text-align: left;
display: block;
margin: 0 auto;
padding: 10px;
border-radius: 8px;
box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

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

input[type="text"],
input[type="email"],
select {
width: 100%;
padding: 8px;
border: 1px solid #ccc;
border-radius: 4px;
box-sizing: border-box; /* Crucial for width alignment */
}
46 changes: 40 additions & 6 deletions Form-Controls/index.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<!DOCTYPE html>
<html lang="en">
<head>
<link href="index.css" rel="stylesheet">
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>My form exercise</title>
Expand All @@ -13,15 +14,48 @@ <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>
<form class="order-form">
Comment on lines 16 to +17
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I see 2 errors when I paste the code in the w3 validator: https://validator.w3.org/nu/#textarea
How can you fix them?

<h2>T Shirt Order Form</h2>
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?


<!-- Name Field -->
<div class="form-group">
<label for="name">Full Name</label>
<input type="text" id="name" name="name" placeholder="John Robinson" required>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

How can you ensure that the input requires 2 characters?

</div>

<!-- Email Field -->
<div class="form-group">
<label for="email">Email Address</label>
<input type="email" id="email" name="email" placeholder="john@example.com" required>
</div>

<!-- Shirt Colour 3 colours only-->
<div class="form-group">
<label for="colour">T Shirt Colour</label>
<select id="Colour" name="Colour">
<option value="Red">Red</option>
<option value="White">White</option>
<option value="Black">Black</option>
</select>
</div>

<!-- Shirt size xs - xxl -->
<div class="form-group">
<label for="Size">T Shirt Size</label>
<select id="Size" name="Size">
<option value="XS">XSmall</option>
<option value="S">Small</option>
<option value="M">Medium</option>
<option value="L">Large</option>
<option value="XL">XLarge</option>
<option value="XXL">XXLarge</option>
</select>
</div>
</form>
</main>
<footer>
<!-- change to your name-->
<p>By HOMEWORK SOLUTION</p>
<p>By John Robinson</p>
</footer>
</body>
</html>
Loading