Skip to content

Commit dff7e98

Browse files
committed
creating form structure
1 parent 7170d98 commit dff7e98

File tree

2 files changed

+94
-32
lines changed

2 files changed

+94
-32
lines changed

css/store.css

Lines changed: 64 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -85,43 +85,94 @@ html{
8585
.section-1-store{
8686

8787
grid-column: 1/2;
88-
padding: 1.5em;
88+
padding: 4em;
8989

9090
}
9191

92+
9293
.form-container{
9394
display: flex;
9495
flex-direction: column;
9596
}
9697
.form-container>*{
97-
width: 90%;
98+
width: 100%;
9899

99100
}
100101

102+
.form-container fieldset{
103+
border: none;
104+
display: block;
105+
padding: 0;
106+
margin-bottom:1em ;
107+
gap: 1em;
108+
}
109+
110+
.form-container input{
111+
height: 2em;
112+
}
113+
101114
#personal-info{
102-
display: flex;
103-
flex-direction: column;
115+
padding: 0;
116+
display: grid;
117+
grid-template-columns: 1fr 1fr;
118+
grid-template-rows: 1fr 1fr;
119+
grid-template-areas:
120+
"label1 label2"
121+
"fname lname";
104122
}
105123

106-
#personal-info label{
107-
width: fit-content;
124+
125+
126+
#label-fname{
127+
grid-area: label1;
128+
108129
}
109130

110-
#personal-info input{
111-
width: 3em;
131+
#label-lname{
132+
grid-area: label2;
112133
}
113134

135+
#fname{
136+
grid-area: fname;
137+
}
114138

115-
label , input{
116-
display: inline-block;
139+
#lname{
140+
grid-area: lname;
117141
}
118142

119143

120-
.section-1-store fieldset{
121-
border: none;
122-
display: block;
144+
145+
146+
/* styling address field set ----------------- */
147+
#address-info{
148+
display: grid;
149+
padding: 0;
150+
}
151+
152+
/* styling radio buttons */
153+
#karma-radio-color{
154+
display: grid;
155+
grid-template-columns: 1fr 1fr;
156+
grid-template-rows: repeat(2,auto-fit);
157+
}
158+
159+
160+
#karma-radio-color legend{
161+
grid-column: 1/-1;
162+
grid-row: 1;
163+
}
164+
165+
#karma-radio-color #karma-red{
166+
grid-column: 1;
167+
grid-row: 2;
168+
}
169+
170+
#karma-radio-color #space-grey{
171+
grid-column: 2;
172+
grid-row: 2;
123173
}
124174

175+
125176
.section-2-store{
126177
grid-column: 2/-1;
127178

level-2/store.html

Lines changed: 30 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -45,36 +45,47 @@ <h1>
4545
</h1>
4646
<form class="form-container">
4747
<fieldset id="personal-info">
48-
<div>
48+
<!-- <div>
4949
<label for="fname">First Name:</label>
50-
<label for="lname">Last Name:</label>
50+
<input type="text" id="fname" name="fname"/>
5151
</div>
5252
<div>
53-
<input type="text" id="fname" name="fname"/>
53+
<label for="lname">Last Name:</label>
5454
<input type="text" id="lname" name="lname">
55-
</div>
55+
</div> -->
56+
<label for="fname" id="label-fname">First Name:</label>
57+
<input type="text" id="fname" name="fname"/>
58+
<label for="lname" id="label-lname">Last Name:</label>
59+
<input type="text" id="lname" name="lname">
5660
</fieldset>
61+
<fieldset id="address-info">
62+
<label for="address">Address: </label>
63+
<input type="text" id="address" name="address"/>
64+
<label for="address-2">Address 2:</label>
65+
<input type="text" id="address-2" name="address-2"/>
66+
<label for="city">City:</label>
67+
<input type="text" id="city" name="city">
68+
<label for="post-code">Post Code:</label>
69+
<input type="text" id="post-code" name="post-code"/>
5770

58-
<label for="address">Address: </label>
59-
<input type="text" id="address" name="address"/>
60-
<label for="address-2">Address 2:</label>
61-
<input type="text" id="address-2" name="address-2"/>
62-
<label for="city">City:</label>
63-
<input type="text" id="city" name="city">
64-
<label for="post-code">Post Code:</label>
65-
<input type="text" id="post-code" name="post-code"/>
71+
</fieldset>
72+
6673

67-
<fieldset>
74+
<fieldset id="karma-radio-color">
6875
<legend>Select a color:</legend>
69-
<input type="radio" value="karma-orange" name="device-color" id="karma-orange">
70-
<label for="karma-orange">Karma Orange</label>
71-
<input type="radio" value="space-grey" name="device-color" id="space-grey">
72-
<label for="space-grey">Space Grey</label>
73-
74-
<input type="checkbox" id="terms" name="terms-conditions" value="terms">
76+
<span id="karma-red">
77+
<input type="radio" value="karma-orange" name="device-color" id="karma-orange">
78+
<label for="karma-orange">Karma Orange</label>
79+
</span>
80+
<span id="space-grey">
81+
<input type="radio" value="space-grey" name="device-color" id="space-grey">
82+
<label for="space-grey">Space Grey</label>
83+
</span>
84+
7585
</fieldset>
7686

7787
<fieldset>
88+
<input type="checkbox" id="terms" name="terms-conditions" value="terms">
7889
<label for="terms">
7990
By tick this box you are agree with Karma's <a href="#">Terms and Conditions</a>
8091
</label>

0 commit comments

Comments
 (0)