【CSS】CSS を取り込むには...

  ■ HTML内部に記述する方法

 * styleタグに書く

  構文例

<style>
h1 {color: red; }
</style>

 

  ■ 外部CSSを取り込む方法

 * 外部CSS「css1.css」を取り込んでいる

  構文例

<link rel="stylesheet" href="./css1.css" type="text/css">

 

  ■ 複数クラスを指定する方法

 * CSSのクラス「bgcRed」と「fsSmall」をpタグに指定している

  構文例

<p class="bgcRed fsSmall">赤くてちっこい字</p>

 

  ■ サンプル

  フォルダ構成

「*」は、フォルダの意味で、付いてなければ、ファイルを意味する
 * test
 +- index.html (HTMLファイル)
 +- css1.css (CSSファイル・background-color用)
 +- css2.css (CSSファイル・font-size用)

  index.html

<html>
<head>
<link rel="stylesheet" href="./css1.css" type="text/css">
<link rel="stylesheet" href="./css2.css" type="text/css">
</head>
<body>
<p class="bgcRed fsSmall">赤くてちっこい字</p>
<div class="bgcBlue fsLarge">青くてデカイ字</div>
</body>
</html>

  css1.css

.bgcBlue { background-color:blue; }
.bgcRed { background-color:red; }

  css2.css

.fsLarge { font-size: 50pt; }
.fsSmall { font-size: 5pt; }