: CSS3 스타일은 부모 태그로부터 상속한다.
: 자신을 둘러싸는 태그
<p style="color:green">안녕하세요
<em style=“font-size:25px”>자식입니다</em>
</p>
<p> 태그는 <em> 태그의 부모 태그이다.<em> 태그의 출력 : 글자 크기는 25px, 글자 색은 부모를 상속받아 greenQ. CSS에서 Style 속성이 중복될 경우 적용되는 방법은?
A. 가장 구체적인 내용을 해당 태그에 적용한다.
: 태그의 style 속성에 있는 것으로 적용된다.
<html>
<head>
<link rel= "stylesheet" type= "text/css" href= "mystyle.css"/>
</head>
<body>
<h1 style = "color : blue">This is a paragraph. </h1>
</html>
/* mystyle.css 의 내용*/
body { background-color : lightblue; }
h1 { color : navy ; margin-left : 20px; }
<html>
<head>
<title> 헤드 퍼스트 라운지 건강 음료 </title>
<link type = “text/css” rel = “stylesheet” href = “lounge.css” >
</head>
<body>
<h1> 음료 목록 </h1>
<h2> 시원한 녹차 </h2>
<p class = "greentea raspberry blueberry" >
<img src= " ./images/green.jpg"> 비타민과 미네랄이 가득한, 카밀레 꽃과 생강 한 조각이 들어간 건강에 좋은 녹차.
</p>
</body>
</html>
p.greentea{
color : green;
}
p.blueberry{
color : purple
}
p.rasberry{
color : blue
}
<p class="greentea"> 로 수정<html>
<head>
<style>
p.normal { font-style: normal; }
p.italic { font-style: italic; }
p.oblique { font-style: oblique; }
</style>
</head>
<body>
<p class="normal">This is a paragraph in normal style.</p>
<p class="italic">This is a paragraph in italic style.</p>
<p class="oblique">This is a paragraph in oblique style.</p>
</body>
</html>
<html>
<head>
<style>
p {
font-family : Arial, Helvetica, sans-serif;
}
#cursive-div {
font-family : ‘Cool Linked Font’, cursive;
}
</style>
</head>
<body>
<div id = “cursive-div”>
<h3> Cursive </h3>
<p> This paragraph is in a cursive font. </p>
</div>
</body>
</html>
: 글꼴의 변형을 지정한다.
<html>
<head>
<style>
p.normal { font-variant: normal; }
p.small { font-variant: small-caps; }
</style>
</head>
<body>
<p class="normal">Madagascar.</p>
<p class="small">small-caps, Madagascar. </p>
</body>
</html>

: 배경을 설정
<html>
<head>
<style>
body { background: url(background.jpg) no-repeat top right }
</style>
</head>
<body>
<h1>Hello World!</h1>
</body>
</html>
style 속성이 가장 우선.font-style: normal, italic, oblique.font-family: 글꼴 지정, 대체 글꼴 설정 가능.font-size: px, em, %로 크기 지정.font-variant: normal, small-caps.background-color, color, border로 배경색, 글자색, 테두리색 지정.rgb, rgba, hexcode, 색상 이름으로 색 지정.background-color, background-image, background-position, background-repeat 등 사용.