<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UFT-8">
<title>CSS</title>
<!--スタイルシートを別ファイルで持ちます-->
<link REL="stylesheet" type="text/css" HREF="./StyleSheet/aSampleStyle.css">
</head>
<body>
<div>
<h1>CSS入門</h1>
<h2>cssサンプル</h2>
</div>
<p>ここで文章を追加します</p>
<p>もう一行追加します</p>
</body>
</html>
<!--style-->
body {
/*background: #eaeaea;*/
font-family: Meiryo;
text-align: center;
}
div {
background: #d2e4b3;
width: 300px;
padding: 10px;
text-align: center;
border: 5px solid #cccccc;
margin: 30px auto;
}
/* h1 CSS入門 */
h1 {
color: rgb(158, 58, 58);
}
/* h2 cssサンプル*/
h2{
color: rgb(38, 105, 38);
font-family: 'Courier New', Courier, monospace;
}
下はスタイルシート、上はそれを呼び出す方。