-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhealth_profile.css
More file actions
271 lines (246 loc) · 10.8 KB
/
health_profile.css
File metadata and controls
271 lines (246 loc) · 10.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
body{
margin: 0;
padding: 0;
width: 100%;
height: 1024px;
display: flex;
justify-content: center;
align-items: center;
background-image: url(img/pic_health.png);
background-size: cover; /* เพิ่มเพื่อให้รูปภาพครอบคลุมพื้นที่ */
background-position: center; /* จัดตำแหน่งรูปภาพให้อยู่กลาง */
}
.health_data{
width: 860px;
height: 745px;
justify-content: center;
align-items: center;
background-color: rgb(255, 255, 255);
border-radius: 20px;
padding: 30px 30px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
.health_data form{
font-size: 20px;
padding-left: 90px;
}
.health_data form .field{
display: flex;
}
input{
margin-top: 15px;
}
input[type="number"] {
width: 170px;
height: 35px;
border: 1px solid #ccc;
border-radius: 5px;
padding-left: 10px;
}
input[type="radio"] {
width: 20px;
height: 20px;
}
input[type="checkbox"] {
width: 20px;
height: 20px;
}
button{
width: 200px;
height: 50px;
border-radius: 8px;
background-color: #4A6BFF;
color: white;
cursor: pointer;
border: 1px solid #ffffff;
margin-left: 230px;
font-size: 20px;
}
button:hover{
background-color: #3A5BFF;
color: white;
transition: background-color 0.3s;
transform: scale(1.0);
box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}
a{
width: 150px;
height: 40px;
font-size: 18px;
text-decoration: none;
color: #555555;
}
a:hover{
/* color: #4A6BFF; */
font-weight: bold;
transition: color 1.0s;
}
h1, p{
text-align: center;
}
p{
color: #949494;
}
/* ปรับขนาดหน้าจอที่ต้องการให้ Responsive */
@media screen and (min-width: 768px) and (max-width: 900px) {
body {
display: flex;
justify-content: center;
align-items: center;
margin: 0; /* กำจัด margin default */
padding: 0; /* กำจัด padding default */
min-height: 100vh; /* กำหนดความสูงขั้นต่ำเท่ากับ viewport */
background-image: url(img/pic_health.png);
background-size: cover; /* ให้รูปภาพครอบคลุมพื้นที่ทั้งหมด */
background-position: center center; /* จัดตำแหน่งรูปภาพให้อยู่กลาง */
background-repeat: no-repeat;
background-attachment: fixed; /* ให้พื้นหลังไม่เลื่อนตาม scroll */
}
.health_data {
padding: 20px; /* ลด padding โดยรวม */
width: 80%; /* ใช้ความกว้างเกือบเต็มหน้าจอ */
height: auto; /* ปรับความสูงให้เหมาะสมกับเนื้อหา */
margin: 20px auto; /* จัดให้อยู่ตรงกลาง */
}
.health_data h1 {
font-size: 24px; /* ปรับขนาดหัวข้อ */
margin-top: -10px; /* เพิ่มระยะห่างด้านล่าง */
}
.health_data p {
font-size: 14px; /* ปรับขนาดข้อความ */
margin-top: -10px; /* เพิ่มระยะห่างด้านล่าง */
}
.health_data a {
margin-bottom: 20px; /* เพิ่มระยะห่างด้านล่างของปุ่มย้อนกลับ */
display: inline-block; /* ทำให้สามารถกำหนด margin ได้ */
}
.field {
flex-direction: column; /* ทำให้ input age, weight, height เรียงลงมา */
align-items: flex-start; /* จัดชิดซ้าย */
position: relative;
}
.health_data form{
padding-left: 0; /* ลบ padding ด้านซ้าย */
margin-top: -20px; /* เพิ่มระยะห่างด้านบน */
}
.input_age,
.input_weight,
.input_height {
width: 100%; /* ให้ input แต่ละตัวมีความกว้างเต็มพื้นที่ */
margin-right: 0; /* ลบ margin ด้านขวา */
margin-bottom: 15px; /* เพิ่มระยะห่างด้านล่างระหว่าง input */
}
.input_age input,
.input_weight input,
.input_height input {
width: calc(100% - 100px); /* ปรับความกว้างของ input ให้พอดีกับข้อความ "ปี", "กก.", "ซม." */
display: inline-block; /* จัดให้อยู่ในบรรทัดเดียวกับข้อความหน่วย */
vertical-align: middle; /* จัดแนวตั้งให้อยู่ตรงกลาง */
}
.input_age span,
.input_weight span,
.input_height span {
display: inline-block; /* จัดให้อยู่ในบรรทัดเดียวกับ input */
vertical-align: middle; /* จัดแนวตั้งให้อยู่ตรงกลาง */
margin-left: 5px; /* เพิ่มระยะห่างจาก input */
}
.input_diseases input[type="checkbox"],
.input_activity_level input[type="radio"] {
margin-top: -10px; /* เพิ่มระยะห่างด้านล่างของ checkbox/radio */
display: inline-block; /* ทำให้ยังคงเรียงในบรรทัดเดียวกันได้ถ้ามีที่พอ */
vertical-align: middle;
}
.input_diseases span,
.input_activity_level span {
display: block; /* ทำให้หัวข้อเรียงลงมา */
margin-top: -10px; /* เพิ่มระยะห่างด้านล่างของหัวข้อ */
}
button[type="submit"] {
width: 30%;
padding: 12px;
font-size: 16px;
display: block;
margin: 0 auto; /* จัดกึ่งกลางด้วย margin auto */
}
}
@media (max-width: 768px) {
body {
display: flex;
justify-content: center;
align-items: center;
margin: 0; /* กำจัด margin default */
padding: 0; /* กำจัด padding default */
min-height: 100vh; /* กำหนดความสูงขั้นต่ำเท่ากับ viewport */
background-image: url(img/pic_health.png);
background-size: cover; /* ให้รูปภาพครอบคลุมพื้นที่ทั้งหมด */
background-position: center center; /* จัดตำแหน่งรูปภาพให้อยู่กลาง */
background-repeat: no-repeat;
background-attachment: fixed; /* ให้พื้นหลังไม่เลื่อนตาม scroll */
}
.health_data {
padding: 20px; /* ลด padding โดยรวม */
width: 80%; /* ใช้ความกว้างเกือบเต็มหน้าจอ */
height: auto; /* ปรับความสูงให้เหมาะสมกับเนื้อหา */
margin: 20px auto; /* จัดให้อยู่ตรงกลาง */
}
.health_data h1 {
font-size: 24px; /* ปรับขนาดหัวข้อ */
margin-top: -10px; /* เพิ่มระยะห่างด้านล่าง */
}
.health_data p {
font-size: 14px; /* ปรับขนาดข้อความ */
margin-top: -10px; /* เพิ่มระยะห่างด้านล่าง */
}
.health_data a {
margin-bottom: 20px; /* เพิ่มระยะห่างด้านล่างของปุ่มย้อนกลับ */
display: inline-block; /* ทำให้สามารถกำหนด margin ได้ */
}
.field {
flex-direction: column; /* ทำให้ input age, weight, height เรียงลงมา */
align-items: flex-start; /* จัดชิดซ้าย */
position: relative;
}
.health_data form{
padding-left: 0; /* ลบ padding ด้านซ้าย */
margin-top: -20px; /* เพิ่มระยะห่างด้านบน */
}
.input_age,
.input_weight,
.input_height {
width: 100%; /* ให้ input แต่ละตัวมีความกว้างเต็มพื้นที่ */
margin-right: 0; /* ลบ margin ด้านขวา */
margin-bottom: 15px; /* เพิ่มระยะห่างด้านล่างระหว่าง input */
}
.input_age input,
.input_weight input,
.input_height input {
width: calc(100% - 100px); /* ปรับความกว้างของ input ให้พอดีกับข้อความ "ปี", "กก.", "ซม." */
display: inline-block; /* จัดให้อยู่ในบรรทัดเดียวกับข้อความหน่วย */
vertical-align: middle; /* จัดแนวตั้งให้อยู่ตรงกลาง */
}
.input_age span,
.input_weight span,
.input_height span {
display: inline-block; /* จัดให้อยู่ในบรรทัดเดียวกับ input */
vertical-align: middle; /* จัดแนวตั้งให้อยู่ตรงกลาง */
margin-left: 5px; /* เพิ่มระยะห่างจาก input */
}
.input_diseases input[type="checkbox"],
.input_activity_level input[type="radio"] {
margin-top: -10px; /* เพิ่มระยะห่างด้านล่างของ checkbox/radio */
display: inline-block; /* ทำให้ยังคงเรียงในบรรทัดเดียวกันได้ถ้ามีที่พอ */
vertical-align: middle;
}
.input_diseases span,
.input_activity_level span {
display: block; /* ทำให้หัวข้อเรียงลงมา */
margin-top: -10px; /* เพิ่มระยะห่างด้านล่างของหัวข้อ */
}
button[type="submit"] {
width: 50%;
padding: 12px;
font-size: 16px;
display: block;
margin: 0 auto; /* จัดกึ่งกลางด้วย margin auto */
}
}