css 우선순위
본문
CSS 우선순위 : 1. !important > 2.인라인 > 3.내부 > 4.외부
!important : 모든 style 규칙에 우선적용
사용법: {속성:속성값 !important;}
#test {float:left; margin:0 !important;}
인라인 : 해당 테그에 바로 적용
<span style="font-size:12pt; color:gray;">인라인 CSS</span>
내부: 페이지 내에서 <style>로 선언
<style>
#test {font-size:12pt; color:gray;}
</style>
<div id="test">내부 CSS</div>
외부: 외부파일 불러옴
외부에 css파일을 만들고 <head></head>사이에서 불러온다.
<head>
<link rel="stylesheet" href="/css/main.css" type="text/css" />
</head>
댓글목록
등록된 댓글이 없습니다.