React CSS 적용방법
vscode / windows10 환경
1. my-app / src / pages / Home.css 라는 파일을 생성
2. Home.css 파일안에 적용할 스타일 작성
1
2
3
4
5
6
7
body {
background-color: white;
color: red;
margin: 10px;
font-family: Arial;
text-align: center;
}
3. index.js 폴더에 import 시켜주기
1
import './pages/Home.css'
4. index.html 파일에 link 엘리먼트 추가하기
1
<link rel="stylesheet" href="../my-app/src/pages/Home.css">
5. 확인
1
localhost:3000