Skip to content

Commit 3c0b3ab

Browse files
committed
styling improved after lighthouse, html fixed with validator
1 parent a0a256f commit 3c0b3ab

2 files changed

Lines changed: 39 additions & 23 deletions

File tree

Form-Controls/index.html

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<!DOCTYPE html>
22
<html lang="en">
33
<head>
4-
<meta charset="utf-8" />
5-
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
4+
<meta charset="utf-8" >
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge" >
66
<title>My form exercise</title>
7-
<meta name="description" content="" />
8-
<meta name="viewport" content="width=device-width, initial-scale=1" />
7+
<meta name="description" content="T-shirt order form, pick your product." >
8+
<meta name="viewport" content="width=device-width, initial-scale=1" >
99
<link rel="stylesheet" href="/styles.css">
1010
</head>
1111
<body>
@@ -23,9 +23,9 @@ <h1>Product Pick</h1>
2323
<label for="email">Email Address</label>
2424
<input type="email" name="email" id="email" required placeholder="myemail@email.com">
2525
<!--Color 3 options with select NO multiselect-->
26-
<label for="colorOptions">Choose Color</label>
26+
<label for="colorOptions">Color</label>
2727
<select id="colorOptions" name="color" required>
28-
<option hidden></option>
28+
<option hidden>Choose here</option>
2929
<option value="grey" >Grey</option>
3030
<option value="black" >Black</option>
3131
<option value="white" >White</option>
@@ -77,7 +77,6 @@ <h1>Product Pick</h1>
7777
</form>
7878
</main>
7979
<footer>
80-
<!-- change to your name-->
8180
<p>By Bartosz Kawiak</p>
8281
</footer>
8382
</body>

Form-Controls/styles.css

Lines changed: 33 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,17 @@ body{
55

66
h1{
77
justify-self: center;
8-
scale: 1.5;
8+
font-size: clamp(1rem, 10vw, 3rem);
9+
justify-content: center;
910
}
1011

1112
fieldset {
1213
background-color: antiquewhite;
1314
position: relative;
1415
display: grid;
1516
gap: 0.5rem;
16-
max-width: 90%;
17+
max-width: 500px;
18+
height: auto;
1719
justify-self: center;
1820
border: 2px solid ;
1921
margin: auto;
@@ -23,7 +25,7 @@ fieldset {
2325
legend {
2426
margin: auto;
2527
padding: 1rem;
26-
color: red;
28+
color: rgb(87, 0, 0);
2729
font-size: larger;
2830
text-decoration: underline;
2931
text-decoration-color: black;
@@ -32,10 +34,15 @@ legend {
3234
}
3335
select{
3436
padding: 10px;
37+
max-width: 100%;
38+
box-sizing: border-box;
3539
}
40+
option{
41+
max-width: 100%;
42+
}
3643

3744
select:focus{
38-
scale: 1.1;
45+
/* scale: 1.1; */
3946
background-color: coral;
4047
color: white;
4148
}
@@ -46,14 +53,14 @@ input{
4653
}
4754

4855
input:focus{
49-
scale: 1.1;
56+
/* scale: 1.1; */
5057
background-color: coral;
5158
color: white;
5259
}
5360

54-
input[type="text", "email"]:valid{
55-
background-color: coral;
56-
61+
input[type="text"]:valid,
62+
input[type="email"]:valid{
63+
background-color: coral;
5764
}
5865

5966
input:focus::placeholder{
@@ -66,12 +73,6 @@ input:focus::placeholder{
6673
justify-items: center;
6774
}
6875

69-
70-
/*input[type="radio"] {
71-
justify-self: baseline;
72-
display: inline-block;
73-
} */
74-
7576
input[type="radio"]:checked {
7677
accent-color: coral;
7778
}
@@ -97,6 +98,7 @@ p{
9798
#buttonGroup{
9899
justify-self: center;
99100
font-size: larger;
101+
max-width: 500px;
100102
}
101103

102104
button{
@@ -116,7 +118,22 @@ button:active{
116118
}
117119

118120
footer{
119-
opacity: 0.5;
121+
opacity: 0.8;
120122
font-style: italic;
121-
123+
scale: 0.8;
124+
justify-content: center;
125+
text-align: center;
126+
}
127+
128+
@media (max-width: 600px) {
129+
#sizeDiv {
130+
grid-template-columns: repeat(1, 1fr);
131+
}
132+
#buttonGroup{
133+
justify-self: center;
134+
display: grid;
135+
width: 100%;
136+
justify-content: center;
137+
138+
}
122139
}

0 commit comments

Comments
 (0)