<h1 style="color:red; font-style: italic">Hello World<h1>
<!DOCTYPE html>
<html>
<head>
<title>Page title</title>
<style>
h1 {
color: red;
font-style: italic;
}
/* 모든 h1 태그에 빨간색, 기울임꼴을 적용 */
</style>
</head>
<body>
<h1>Hello world</h1>
<div>Contents here
<span>Here too!<span>
</div>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>Page title</title>
<link rel="stylesheet" type="text/css" href="myFirstStyle.css" />
</head>
<body>
<h1>Hello world</h1>
<div>Contents here
<span>Here too!<span>
</div>
</body>
</html>h1 {
color: red;
font-style: italic;
}
/* 모든 h1 태그에 빨간색, 기울임꼴을 적용 */ css에서 요소(element)를 선택하는 규칙