미디어쿼리를 작성해서 인터넷 창의 크기에 따라 다르게 화면 구성을 하도록 적용해봤다.
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
|
@media screen and (max-width: 1125px) {
.area1 {
display: block;
}
.text1 {
margin-left: 100px;
margin-bottom: 50px;
}
.image1 {
margin-left: 100px;
}
.area2 {
display: block;
margin-bottom: 50px;
}
.image2 {
margin-left: 50px;
}
.area3 {
display: block;
}
.text3 {
margin-left: 100px;
margin-bottom: 50px;
}
.image3 {
margin-left: 100px;
}
.area4 {
display: block;
margin-bottom: 50px;
}
.image4 {
margin-left: 100px;
margin-bottom: 50px;
}
.text4 {
margin-left: 100px;
}
}
|
cs |
먼저 Home 페이지에 적용된 미디어쿼리다.
1125px 이하라면 area 영역마다 display: block; 를 적용하면 요소들 앞 뒤로 줄바꿈해준다.
그리고 각각의 요소들의 margin 영역을 늘려서 적절한 위치로 적용시킨다.
1
2
3
4
5
6
7
8
9
10
11
12
13
|
@media screen and (max-width: 1090px) {
.container {
justify-content: space-between;
}
.gaji {
margin-left: 30px;
margin-right: 30px;
}
.menus {
display: none;
}
}
|
cs |
header에서 창 크기가 1090px 이하면 menu 요소들의 display를 none으로 적용해서 아예 안보이도록 한다.
'WEB > React' 카테고리의 다른 글
[React] Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object. 오류 해결방법 (0) | 2023.09.08 |
---|---|
[React] 당근마켓 클론코딩 - 간단한 부분들만 (0) | 2023.08.22 |
[React] 날씨 앱 구현해보기 (유사 클론코딩) (0) | 2023.08.13 |
[React] 데이터 필터링 간단 구현 (전체, true, false) (0) | 2023.08.11 |