인라인 > 내부 > 외부
1. 인라인
<h1 👉style="color: red;"👈>Hello world</h1>
2. 내부
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>css 기본</title>
👉 <style>
h1 {
color: red;
}
</style> 👈
</head>
<body>
<h1>hello world</h1>
</body>
</html>
3. 외부
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>css 기본</title>
<link rel="stylesheet" href="004.css"> 👈
or
@import url("004.css"); 👈
= @import url(004.css);
= @import url("./004.css");
= @import "004.css";
</head>
<body>
<h1>hello world</h1>
</body>
</html>
'HTML·CSS' 카테고리의 다른 글
[CSS] position (0) | 2022.02.08 |
---|---|
[CSS] float (0) | 2022.02.08 |
[HTML] 블록 요소와 인라인 요소 (0) | 2022.02.07 |
[HTML] table 태그 (0) | 2022.02.04 |
[CSS] 단위 (0) | 2022.02.04 |