HTML 파일의 <head>
태그와 </head>
태그 안에서 정의
<style>
태그와 </style>
태그 사이에 작성
<!-- index.html -->
<head>
<style>
<!-- 여기에 작성 -->
</style>
</head>
<body>
</body>
<style>
태그 없이 <link>
태그만 사용해 미리 만들어 놓은 외부 스타일 시트 파일 연결
<!-- index.html -->
<link rel="stylesheet" href="style.css">
href
에 css파일의 경로를 작성해준다.
index.html과 style.css가 같은 수준에 있다면 "style.css"
라고 적는다.
index.html과 css폴더가 같은 수준에 있고, css폴더 밑에 style.css가 있다면 경로에 "css/style.css"
라고 적는다.
보통 외부 스타일 시트 방식을 제일 많이 쓴다.
태그 안에 직접적으로 style을 설정해준다.
<!-- index.html -->
<p style="color: blue">블루베리</p>