inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

비전공자를 위한 진짜 입문 올인원 개발 부트캠프

[그랩마켓] React로 웹 개발하기 - 2

상품이 아래로 나열되요 ㅜ

해결된 질문

359

thhwang

작성한 질문수 2

0

똑같은 css파일인데 왜 다르게 나타날까요 ㅠㅠhtml 코드로 만들었을 때.PNGreact로 만들었을 때.PNG위가 처음에 react없이 그냥 html로만 만든거구요

아래가 react로 만든건데

같은 index.css파일인데 왜 다르게 나타날까요 ㅠㅠ

javascript nodejs react-native 머신러닝 배워볼래요? express HTML/CSS react tensorflow

답변 1

3

그랩

아마 product-list쪽 flex 설정 부분이 다르게 작성되지 않았을까 하는데요.

index.css를 보여주시면 조금 더 확인하기 쉬울 것 같아요!

 

0

thhwang

* {
  margin: 0;
  padding: 0;
}

#header {
  height: 64px;
  display: flex;
  justify-content: center;
  border-bottom: 1px solid gray;
}

#body {
  height: 100%;
  width: 1024px;
  margin: 0 auto;
  padding-bottom: 24px;
}

#footer {
  height: 200px;
  background-color: rgb(230, 230, 230);
}

#banner {
  height: 300px;
  background-color: yellow;
}

#header-area {
  width: 1024px;
  height: 100%;
  display: flex;
  align-items: center;
}

#header-area > img {
  width: 240px;
  height: 60px;
}

#banner > img {
  width: 100%;
  height: 300px;
  background-color: #def1de;
}

#body > h1 {
  margin-top: 16px;
}

#product-list {
  display: flex;
  flex-wrap: wrap;
  margin-top: 12px;
}

.product-card {
  width: 180px;
  height: 300px;
  margin-right: 10px;
  margin-bottom: 10px;
  border: 1px solid rgb(230, 230, 230);
  border-radius: 12px;
  overflow: hidden;
}

.product-img {
  width: 100%;
  height: 180px;
}

.product-contents {
  display: flex;
  flex-direction: column;
  padding: 10px;
}

.product-name {
  font-size: 20px;
  margin: 0 auto;
}

.product-price {
  font-size: 16px;
  font-weight: 600;
  margin: 0 auto;
  margin-top: 4px;
}

.product-seller {
  display: flex;
  align-items: center;
  margin-top: 12px;
}

.product-avatar {
  width: 24px;
}

이렇게 했습니다!

0

그랩

음 잘 작성해주신 것 같은데요!

css가 같으면 아마 react쪽 컴포넌트에서 product-list가 id에 잘들어가 있는지 확인해보시면 좋을 것 같아요! 계속 안되면 개발자 도구를 활용해서 해당 요소에 css가 잘 작성되었는지 확인해보면 좋을 것 같네요

https://www.youtube.com/watch?v=rcuycJWjCA0&ab_channel=%EC%86%8C%ED%94%84%ED%8A%B8%EC%A1%B4

0

thhwang

react쪽 컴포넌트쪽에 product-list의 닫아주는 </div> 요놈이 빠져있네요 ㅜㅜㅜ

해결됐습니다!

[해결]그랩님 답변 주세요.

0

193

2

그랩님의 답변을 기다립니다/102강 전반적인 에러

0

167

2

[그랩님께]101강 안드로이드 에러들(Key prop)해결방법 궁금합니다.

0

140

2

[재질문][그랩님 답변 부탁드립니다]101강

0

164

2

[그랩님 답변 부탁드립니다]101강 Axios 에러와 502 Bad Gateway 질문

0

120

2

Ngrok 설치 후 forwarding Url 에러

0

151

2

[그랩님께,Ngrok 악성코드 인식 해결방법]질문 드립니다.

0

257

2

Ngrok 설치 후 forwarding Url로 연결 불가

0

159

1

그랩님,[꼭] 답변 부탁드립니다.

0

78

1

[꼭][[꼭] 그랩님, 답변 부탁드립니다], Failed to load resource: the server responded with a status of 404 (Not Found) 상품 상세 페이지 질문입니다.

0

163

1

6강/7강 수업

0

56

1

그랩님, 상품 상세 페이지 에러와 의문점 질문드립니다.

0

106

2

그랩님, 해결되지 않은 에러 메시지 [꼭] 답변 부탁 드립니다.

0

150

2

[재 질문]Cannot read properties of undefined (reading 'map') TypeError: Cannot read properties of undefined (reading 'map') 에러 해결 어떻게 하나요?

0

96

1

Cannot read properties of undefined (reading 'map') TypeError: Cannot read properties of undefined (reading 'map') 에러 해결 어떻게 하나요?

0

136

2

일반적인 css 꾸미기에서 width와 height의 값?

0

99

2

Windows에서의 업로드 후 홈화면 상품이미지 오류 해결방법

0

205

1

그랩마켓 웹화면 구현하기 -2 질문입니다.

0

127

1

react에 반영이 되지 않습니다.

0

254

1

터미널 npm install -g create-react-app 작성 후 오류

0

430

1

create-react-app my app 실행 시 에러

0

358

2

포스트맨 질문

0

105

1

<꼭 답변 부탁 드립니다>그랩선생님, [컴포넌트 사용하기] 강의에서 질문 있습니다.

0

271

2

그랩선생님, 질문 답변 부탁 드립니다.vscode에서 npm install -g create-react-app 입력 후 에러 입니다.

0

499

2