아래의 extension을 vscode에서 설치 해주세요
live sass compiler
live server
CSS Naming Convention
index.html 준비
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
</head>
<body>
<div class="container1">
<h1>Hello</h1>
</div>
<div class="container2">
<h1>World</h1>
</div>
</body>
</html>
sass 파일 생성
style.scss
body {
background : pink
}
live sass 실행
아래와 같이 output 결과가 나오면서 scss
가 css
로 컴파일 됩니다.
아래와 같이 style.css와 style.css.map을 생성하게 됩니다.
style.css 연결
이제 컴파일된 css 파일을 index.html에 연결하면 됩니다. 아래의 코드를 <header>
안에 넣어 주세요
<link rel="stylesheet" href="style.css" />
live server 실행
그러면 다음과 같은 화면을 볼 수 있습니다.
크게 4개의 메인과 2개의 사이드 기능이 있습니다.