Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
62 changes: 62 additions & 0 deletions Form-Controls/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
body {
font-family: Arial, sans-serif;
padding: 20px;
background-color: #408db7;
}

.header {
text-align: center;
margin-bottom: 20px;
background-color: #f0f8ff;
padding: 3px;
border-radius: 9px;
font-family: Arial;
font-style: bold;
font-size: medium;
}


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

.form-selections {
width: 60%;
background:#f0f8ff;
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: 10px;
font-weight: 600;
}

input[type="text"],
input[type="email"],
select {
width: 100%;
padding: 10px;
border: 1px solid #ccc;
border-radius: 10px;
box-sizing: border-box; /* Crucial for width alignment */
}

.footer {
text-align: left;
margin-top: 20px;
background-color: #408db7;
padding: 20px;
}
47 changes: 37 additions & 10 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 @@ -9,19 +10,45 @@
</head>
<body>
<header>
<h1>Product Pick</h1>
<h1>T Shirt Order Form</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>
<!-- Name Field -->
<div class="form-inputs">
<label for="name">Full Name</label>
<input type="text" id="name" name="name" required pattern =".*\S.*\S.*" placeholder="John Robinson">

<label for="email">Email Address</label>
<input type="email" id="email" name="email" required pattern="^[^\s@]+@[^\s@]+\.[^\s@]+$" placeholder="john@example.com">
</div>

<!-- Shirt Colour 3 colours only-->
<div class="form-selections">
<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>


<!-- Shirt size xs - xxl -->

<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>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

There is a way to configure a <select> element so that no option is selected by default, allowing the user to make an explicit choice.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Thank you, thats great & have added that

<option value="L">Large</option>
<option value="XL">XLarge</option>
<option value="XXL">XXLarge</option>
</select>
</div>
</form>
</main>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Indentation is slightly off.

Consider enabling VS Code's "Format on Save" option or to use its "Format Document" command to keep your code consistently formatted.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I have indented the HTML code, Thanks

<footer>
<!-- change to your name-->
<p>By HOMEWORK SOLUTION</p>
<p>By John Robinson</p>
</footer>
</body>
</html>
</html>
Loading