<h2 style="font-family:돋움,serif; font-size:30px color:blue; background-color:yellow; ">인라인 스타일 적용</h2>
<style type="text/css">
h3{
font-family: 돋움, serif;
font-size:20px;
background:#CC9966;
}
</style>
1. <link rel="stylesheet" type="text/css" href="./style.css">
2. <style type="text/css">
@IMPORT url("style.css");
</style>
<!DOCTYPE html>
<html>
<head>
<meta charset="EUC-KR">
<title>Insert title here</title>
<style type="text/css">
a{
text-decoration: none;
}
*{
font-size:14px;
}
.gold{
color:#FFEB5A;
}
.orange{
color:orange;
}
.silver{
color:silver;
}
#blue_border{
border:1px;
border-style:dotted;
border-color:blue;
padding : 20px 10px ;
margin: 20px 20px;
display:inline-block;
}
#red_border{
border:1px;
border-style:solid;
border-color:red;
padding : 30px;
}
#layer1{
padding : 20px;
}
#layer1 ul{
list-style-type:none;
display:inline;
padding : 20px;
}
#layer1 ul li{
float:left;
border:2px;
background: green;
padding : 10px 10px;
}
/*태그선택자와 클래스 선택자 조합*/
p.gold{
background-color:black;
}
/*가상 클래스 선택자*/
a:LINK{
color:##FF0000;
text-decoration:underline;
}
a:HOVER{
color:#CC0303;
text-decoration:underline;
}
/*속성 성택자*/
div[title = def]{
font-size:30px;
font_style:italic;
color:green;
}
a[href $=pdf]{
font-size:30px;
font-style:italic;
color:orange;
}
</style>
</head>
<body>
<h3>선택자 이해</h3>
<hr>
<div title="abc">abcdef</div>
<div title="def">defffff</div>
<a href="abc.pdf">pdf파일</a>
<a href="abc.gif">gif파일</a>
<a href="aac.pdf">pdf파일</a>
<ul>
<li>전역선택자</li>
<li>태그선택자</li>
<li>클래스선택자</li>
<li>아이디선택자</li>
<li>후손선택자</li>
<li>태그선택자와클래스선택자조합</li>
<li>태그선택자와아이디선택자조합</li>
<li>가상클래스선택자</li>
<li>속성선택자</li>
</ul>
<div class="gold">GOLD2</div>
<p class="gold">GOLD</p>
<p class="orange">ORANGE</p>
<p class="silver">SILVER</p>
<div id="blue_border">BLUE_BORDER</div>
<div id="red_border">RED_BORDER</div>
span태그는 <span>글자선택</span>블럭 역할의 태그이다.
<div>오늘은 <span>에어콘</span>도 안되고
<p><span>힘들다</span></p>
</div>
<div id="layer1">
<ul>
<li>항목1</li>
<li>항목2</li>
</ul>
</div>
<div id="layer2">
<ul>
<li>항목1</li>
<li>항목2</li>
</ul>
</div>
<a href="http://www.naver.com">네이버</a>
</body>
</html>