css 코드가 짧을 경우(html 문서 내에서 해결하고자 할 때)
html문서 내에서 <style></style>태그를 이용한다.
css 코드가 길 경우(css 파일을 연결하고자 할 때)
html문서에서 스크립트 파일로 저장된(별도의 파일로 저장된) css파일(.css)을 연결시키고자 할 때
html문서에서 <link>태그의 href속성, 즉 <link href>를 이용해서 css파일을 연결시킨다.
· <link rel="stylesheet" href="css파일경로">
▶예시
· <link>태그 + href속성
· <link rel="stylesheet" href="anniversary-calculator.css">
<!doctype html>
<html lang="ko">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>aniversary calclulator</title>
<link rel="stylesheet" href="anniversary-calculator.css">
</head>
<body>
...
'1-2 css' 카테고리의 다른 글
[css] Block level element, Inline element_박스 기본 영역 (0) | 2021.07.08 |
---|---|
[css] id, class속성 (0) | 2021.07.07 |
[css] 속성 간략하게 쓰기 (0) | 2021.07.05 |
[css] 선택자(Selector), css의 속성(Property) (0) | 2021.06.25 |
[css] css 시작하기 (0) | 2021.05.10 |