Skip to content

Commit 1e6e752

Browse files
committed
fix accessability issues.
1 parent 0631795 commit 1e6e752

2 files changed

Lines changed: 34 additions & 24 deletions

File tree

Form-Controls/index.html

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="en">
33
<head>
44
<meta charset="utf-8" />
@@ -14,13 +14,24 @@ <h1>Product Pick</h1>
1414
</header>
1515
<main>
1616
<form>
17-
<p> please enter the required (*) information to order your T-shirt. </p>
17+
<p>please enter the required (*) information to order your T-shirt.</p>
1818
<fieldset>
1919
<legend>Customer Information</legend>
2020
<label for="name">Name:*</label>
21-
<input type="text" id="name" name="name" required pattern="[A-Za-z\s]{2,50}" />
22-
<br />
23-
<span class="error-message">Please enter a valid name (2-50 characters, letters and spaces only).</span>
21+
<input
22+
type="text"
23+
id="name"
24+
name="name"
25+
required
26+
pattern="[A-Za-z\s]{2,50}"
27+
/>
28+
<br />
29+
<span class="error-message"
30+
><p>
31+
Please enter a valid name (2-50 characters, letters and spaces
32+
only).
33+
</p>
34+
</span>
2435
<br />
2536
<label for="email">Email:*</label>
2637
<input type="email" id="email" name="email" required />
@@ -35,15 +46,15 @@ <h1>Product Pick</h1>
3546
color of T-shire (choose one from 3 option)
3647
size of T-shirt (choose one from xs, s, m, l, xl,xxl)-->
3748
<fieldset>
38-
<legend>Product Information</legend>
49+
<legend>Product Information</legend>
3950
<label for="color">Color:*</label>
4051
<select id="color" name="color" required>
4152
<option value="">--Please choose a color--</option>
4253
<option value="red">Red</option>
4354
<option value="blue">Blue</option>
4455
<option value="green">Green</option>
4556
</select>
46-
<br />
57+
<br />
4758
<label for="size">Size:*</label>
4859
<select id="size" name="size" required>
4960
<option value="">--Please choose a size--</option>
@@ -54,9 +65,9 @@ <h1>Product Pick</h1>
5465
<option value="xl">XL</option>
5566
<option value="xxl">XXL</option>
5667
</select>
57-
</fieldset>
58-
<label for ="submit"></label>
59-
<input type="submit" id="submit" value="Submit Order"/>
68+
</fieldset>
69+
<label for="submit"></label>
70+
<input type="submit" id="submit" value="Submit Order" />
6071
</form>
6172
</main>
6273
<footer>

Form-Controls/style.css

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
:root {
22
--paper: oklch(7 0 0);
3-
--ink: color-mix(in oklab, var(--color) 5%, black);
3+
--ink: color-mix(in oklab, var(--color) 5%, Green);
44
--font: 100%/1.5 system-ui;
55
--space: clamp(6px, 6px + 2vw, 15px);
66
--container: 1280px;
@@ -20,28 +20,27 @@ body {
2020
max-width: var(--container);
2121
margin: 0 auto calc(var(--space) * 4) auto;
2222
}
23+
p {
24+
margin: auto;
25+
}
2326
h1 {
24-
2527
text-align: center;
2628
}
27-
input:invalid
28-
{
29-
border-color:red;
29+
input:invalid {
30+
border-color: rgb(255, 64, 0);
3031
}
3132
span {
32-
color: grey;
33+
font-size: smaller;
3334
}
34-
input:valid
35-
{
36-
border-color:green;
35+
input:valid {
36+
border-color: green;
3737
}
3838
fieldset:focus-within {
39-
border-color:blue;
39+
border-color: green;
4040
}
41-
footer{
42-
background-image: linear-gradient(to right, grey, lightgreen);
43-
width:var(--container);
41+
footer {
42+
width: var(--container);
4443
position: fixed;
4544
bottom: 0;
4645
text-align: center;
47-
}
46+
}

0 commit comments

Comments
 (0)