Binary World

<CSS> CSS 적용 순서 본문

개발자의 길/Web Programming

<CSS> CSS 적용 순서

모쿠 2017. 3. 30. 11:03

<CSS의 적용 순서>


- <head>안에 넣는 순서에 따라 적용 순서가 바뀜(가장 마지막에 선언한 값이 적용됨)

- 일반적으로 link를 먼저 선언


<02_css.html>


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>CSS</title>
 
<link rel="stylesheet" type="text/css"
    href="css/mystyle1.css">
 
<style>
h1 {
    background: lightgrey;
}
</style
</head>
<body>
<h1 style="background: lightgreen;">CSS 적용 순서</h1>
</body>
</html>
cs



<mystyle1.css>


1
2
3
4
5
6
7
8
9
10
@CHARSET "UTF-8";
.div2 {
    color: green;
    font-size: 300%;
}
h1 {
    background: cyan;
    color: red;
}
cs



<출력화면>



'개발자의 길 > Web Programming' 카테고리의 다른 글

<CSS> Color삽입  (0) 2017.03.30
<CSS> Selector(선택자)  (0) 2017.03.30
<CSS> CSS 선언 및 적용  (0) 2017.03.30
<HTML> Form Type  (0) 2017.03.29
<HTML> Input Type  (0) 2017.03.29
Comments