Skip to content
Closed
Changes from 4 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
109 changes: 105 additions & 4 deletions Form-Controls/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,120 @@
<title>My form exercise</title>
<meta name="description" content="" />
<meta name="viewport" content="width=device-width, initial-scale=1" />

<style>
body {
font-family: Arial, sans-serif;
padding: 20px;
}
Comment thread
cjyuan marked this conversation as resolved.
Outdated

form {
max-width: 400px;
}

div,
fieldset {
margin-bottom: 20px;
}

label {
display: block;
margin-bottom: 8px;
}

input,
select,
button {
min-height: 44px;
padding: 10px;
font-size: 16px;
width: 100%;
box-sizing: border-box;
}

fieldset label {
display: flex;
align-items: center;
gap: 10px;
margin-bottom: 12px;
cursor: pointer;
}

input[type="radio"] {
width: 20px;
height: 20px;
}
</style>
</head>
Comment thread
cjyuan marked this conversation as resolved.
Outdated
<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-->
<!-- Name -->
<div>
<label for="name">Name</label>
<input
id="name"
name="name"
type="text"
required
pattern=".*\S.*\S.*"
>
</div>

<!-- Email -->
<div>
<label for="email">E-mail</label>
<input
id="email"
name="email"
type="email"
required
>
</div>

<!-- Colour -->
<fieldset>
<legend>Colour</legend>

<label>
<input type="radio" name="colour" value="red" required>
Red
</label>

<label>
<input type="radio" name="colour" value="blue">
Blue
</label>

<label>
<input type="radio" name="colour" value="green">
Green
</fieldset>

<!-- Size -->
<div>
<label for="size">Size</label>
<select id="size" name="size" required>
<option value="">-- Please choose --</option>
<option>XS</option>
<option>S</option>
<option>M</option>
<option>L</option>
<option>XL</option>
<option>XXL</option>
</select>
</div>

<!-- Submit button -->
<div>
<button type="submit">Submit</button>
</div>
</form>
</main>

<footer>
<!-- change to your name-->
<p>By HOMEWORK SOLUTION</p>
Comment thread
cjyuan marked this conversation as resolved.
Outdated
Expand Down
Loading