Skip to content
88 changes: 63 additions & 25 deletions Form-Controls/index.html
Original file line number Diff line number Diff line change
@@ -1,27 +1,65 @@
<!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>
</html>
<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" />
<link rel="stylesheet" href="style.css">
</head>

<body>
<header>
<h1>Product Pick</h1>
</header>
<main>
<form method="get" class="form-container">
<!-- write your html here -->

<!-- All inputs are required and are labelled for accessibility and have corresponding name, for, and id attributes -->

<!-- Asks for their forename name -->
<label for="fullname">Fullname:</label>
<input type="text" name="fullname" id="fullname" minlength="2" required>
<br>

<!-- Asks for their email -->
<label for="email">Email:</label>
<input type="email" name="email" id="email" required>
<br>

<!-- Gives them the options to choose between 3 colours -->
<label for="colour">T-shirt Colour:</label>
<select name="colour" id="colour" required>
<option value="" selected disabled>Choose a colour</option>
<option value="white">White</option>
<option value="black">Black</option>
<option value="grey">Grey</option>
</select>
<br>

<!-- Gives them the option to choose between 6 sizes -->
<label for="size">T-shirt Size:</label>
<select name="size" id="size" required>
<option value="" selected disabled>Choose 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>
<br>

<!-- Submit button -->
<button type="submit">Submit</button>
<br>
<button type="reset">Reset</buttonb>
</form>
</main>
<footer>
<p>By Muhammad-Burhan Mustafa</p>
</footer>
</body>
</html>
41 changes: 41 additions & 0 deletions Form-Controls/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/* Creates a container for the form that is also centered*/

.form-container{
display: flex;
flex-direction: column;
border-style:solid;
padding: 10px;
max-width:400px;
margin:auto;
font-size: 28px;
}

/* Ensures that inputs and options are standard size and centered*/
.form-container input,
.form-container option{
font-size: 24px;
width:100%;
max-width: 325px;
box-sizing: border-box;
margin-left:auto;
margin-right:auto;
}

/* Ensures that select and buttons are a standard size and centered*/
.form-container select,
.form-container button{
max-width:325px;
width: 100%;
box-sizing: border-box;
margin-left:auto;
margin-right:auto;
font-size: 24px;
}

h1{
text-align: center;
}

footer{
text-align: center;
}
Loading