Skip to content

Commit 4fea05a

Browse files
author
JorvanW
committed
removed non-sementic tags and added more labels and ids to the form controls for better accessibility and styling.
1 parent 64a6300 commit 4fea05a

2 files changed

Lines changed: 26 additions & 24 deletions

File tree

Form-Controls/README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44

55
<!--{{<objectives>}}>-->
66

7-
- [ ] Interpret requirements and check against a list of criteria
8-
- [ ] Write a valid form
9-
- [ ] Test with Devtools
7+
- [x] Interpret requirements and check against a list of criteria
8+
- [x] Write a valid form
9+
- [x] Test with Devtools
1010
- [ ] Refactor using Devtools
11-
- [ ] Use version control by committing often and pushing regularly to GitHub
12-
- [ ] Develop the habit of writing clean, well-structured, and error-free code
11+
- [x] Use version control by committing often and pushing regularly to GitHub
12+
- [x] Develop the habit of writing clean, well-structured, and error-free code
1313
<!--{{<objectives>}}>-->
1414

1515
## Task
@@ -34,8 +34,8 @@ Do not write a form action for this project.
3434

3535
Let's write out our testable criteria. Check each one off as you complete it.
3636

37-
- [ ] I have only used HTML and CSS.
38-
- [ ] I have not used any JavaScript.
37+
- [x] I have only used HTML and CSS.
38+
- [x] I have not used any JavaScript.
3939

4040
### HTML
4141

Form-Controls/index.html

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,36 +10,41 @@
1010
<style>
1111
body {
1212
font-family: Helvetica;
13-
font-size: 30px
13+
font-size: 30px;
1414
}
1515
form {
1616
display: flex;
1717
flex-direction: column;
1818
gap: 10px;
1919
}
2020
input, select {
21-
font-size: 20px;
21+
font-size: 25px;
2222
}
2323
button {
24-
font-size: 20px;
25-
width: 100px;
24+
font-size: 25px;
25+
width: 90px;
2626
}
27+
#name {
28+
width: 500px;
29+
}
30+
#email {
31+
width: 500px;
32+
}
33+
34+
#submit {
35+
width: 150px;
36+
}
2737
</style>
2838
<body>
2939
<header>
3040
<h1>T-Shirts</h1>
3141
</header>
3242
<main>
3343
<form>
34-
<div>
35-
<label>Name</label>
36-
<input>
37-
</div>
38-
<div>
39-
<label>Email</label>
40-
<input>
41-
</div>
42-
<div>
44+
<label for="name">Name</label>
45+
<input id="name" type="text"/>
46+
<label for="email">Email</label>
47+
<input id="email" type="email"/>
4348
<label>Size
4449
<select>
4550
<option value="xsmall">XS</option>
@@ -50,17 +55,14 @@ <h1>T-Shirts</h1>
5055
<option value="xxlarge">XXL</option>
5156
</select>
5257
</label>
53-
</div>
54-
<div>
5558
<label>Colour
5659
<select>
5760
<option value="yellow">Yellow</option>
5861
<option value="black">Black</option>
5962
<option value="pink">Pink</option>
6063
</select>
6164
</label>
62-
</div>
63-
<button>Submit</button>
65+
<button id="submit">Submit</button>
6466
</form>
6567
</main>
6668
<footer>

0 commit comments

Comments
 (0)