[CSS]- inline, internal, external

이재민·2023년 8월 7일
8

HTML

목록 보기
4/4
post-thumbnail

CSS를 적용하는 방법

HTML 파일에 CSS를 적용하는 방식에는 3가지 방식이 있다.

1. External CSS

2. Internal CSS

3. Inline CSS

CSS의 적용 순서

▶ Inline > External = Internal

📖inline css

적용하고자 하는 태그 안에 style 요소를 이용하여 css 적용

ex) <h1 style="color : red; ">내용</h1>

📖internal css

HTML 파일 내부 <head>태그 안에 <style>태그를 이용하여 css를 적용

ex) <head><style>h1{ color : yellow; }</style></head>

📖external css

HTML 파일 외부에 css 파일을 작성하고 link하여 적용하는 방식
<head> 태그 안에 <link> 태그를 이용하여 css파일을 적용한다.

ex) <head><link rel="stylesheet" type="text/css" href="test.css"></head>
profile
안녕하세요

4개의 댓글

comment-user-thumbnail
2023년 8월 7일

정리가 너무 잘 되어있네요! 글 잘 봤습니다.

답글 달기
comment-user-thumbnail
2023년 8월 7일

잘 봤습니다. 좋은 글 감사합니다.

답글 달기
comment-user-thumbnail
2023년 8월 8일

궁금한 부분이 해결되었어요. 감사합니다!

답글 달기
comment-user-thumbnail
2023년 8월 8일

좋댓구알 갑니다~

답글 달기