jQuery | javascript | CSS

06.CSS - 우선순위

Godffs 2009. 7. 27. 16:53
반응형
스타일시트를 중복적용 하게되는 경우에 어떤 어디서 정의된 스타일시트가
먼저 적용이 되는가에 대해 알아보겠습니다.


style속성 > id속성 > class속성 > (style태그>link태그)-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <style type="text/css">
        div { color:Green; }
        .yellow {color:Blue;}
        #redText {color:Red;}
    </style>
    <link rel="Stylesheet" type="text/css" href="02.StyleSheet.css" />
</head>
<body>
    <div class="yellow" id="redText" style="color:Teal;">
        안녕하세요.
    </div>
</body>
</html>


굵은 글씨로 작성된것을 지우고 하나씩 입력해 보세요.


반응형