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
70 changes: 59 additions & 11 deletions Form-Controls/index.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<!DOCTYPE html>
<!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="" />
<title>My form control</title>
<link rel="stylesheet" href="style.css" />
<meta name="description" content="F" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
</head>
<body>
Expand All @@ -13,15 +14,62 @@ <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-->
<fieldset>
<legend>Personal Information</legend>
<label for="name">Name:</label>
<input
type="text"
id="name"
name="name"
autocomplete="name"
pattern="^\s*(\S\s*){2,}$"
required
title="Please enter at least 2 characters"
/>
<label for="email">Email:</label>
<input
type="email"
id="email"
name="email"
autocomplete="email"
required
/>
</fieldset>

<fieldset>
<legend>Please select your color</legend>

<input type="radio" id="black" name="color" value="Black" required />
<label for="black">Black</label>

<input type="radio" id="beige" name="color" value="Beige" />
<label for="beige">Beige</label>

<input type="radio" id="red" name="color" value="Red" />

<label for="red">Red</label>
</fieldset>

<fieldset>
<legend>Please select a size</legend>

<label for="size">Choose a size:</label>
<select name="size" id="size" required>
<option value="" disabled selected>
-- Please choose an option --
</option>
<option value="extra-small">Extra Small</option>
<option value="small">Small</option>
<option value="medium">Medium</option>
<option value="large">Large</option>
<option value="extra-large">Extra Large</option>
<option value="double-extra-large">XXL</option>
</select>
</fieldset>

<input type="submit" value="Submit" />
</form>
</main>
<footer>
<!-- change to your name-->
<p>By HOMEWORK SOLUTION</p>
</footer>
<footer>Product Pick Form</footer>
</body>
</html>
92 changes: 92 additions & 0 deletions Form-Controls/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
header {
background-color: #24362e;
color: white;
text-align: center;
padding: 20px;
}
h1 {
margin: 0;
}
fieldset {
margin-bottom: 20px;
padding: 15px;
border: 1px solid #bbb;
border-radius: 4px;
}
legend {
font-weight: bold;
padding: 5px;
}

fieldset input[type="radio"] {
margin-right: 5px;
}

fieldset label {
display: inline;
margin-right: 15px;
font-weight: normal;
}

body {
font-family: Arial, sans-serif;
background-color: #f5f7fa;
margin: 0;
padding: 0;
color: #333;
}
main {
display: flex;
justify-content: center;
padding: 30px 15px;
}
form {
background-color: white;
padding: 25px;
width: 100%;
max-width: 500px;
border-radius: 8px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
div {
margin-bottom: 20px;
}
label {
display: flex;
margin-bottom: 5px;
font-weight: bold;
}
input[type="text"],
input[type="email"],
select {
width: 100%;
padding: 10px;
border: 1px solid #bbb;
border-radius: 4px;
font-size: 1rem;
}
input[type="submit"]:hover {
background-color: #1b2923;
width: 100%;
color: white;
border: none;
padding: 12px;
border-radius: 4px;
font-size: 1rem;
cursor: pointer;
}
input[type="text"]:focus,
input[type="email"]:focus,
select:focus {
outline: none;
border-color: #24362e;
box-shadow: 0 0 5px rgba(36, 54, 46, 0.3);
}

footer {
text-align: center;
background-color: #24362e;
color: white;
padding: 15px;
margin-top: 20px;
}