※こちらの記事は、Visual Studio Codeがインストールされている事が前提で記述してあります。もしVisual Studio Codeがインストールされていない方は、こちらの記事を参考にしてください。
手順
- HTMLとCSSを準備する。
- HTMLに、h1タグとpタグで適当な文字を書く。
- CSSでh1タグの文字の色を赤に、背景の色を青にする。
- CSSで、pタグの文字の色を黄色に、背景の色を緑にする。
回答例
作成したコード
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" h ref="css/style.css">
</head>
<body>
<h1>見出しです</h1>
<p>段落です</p>
</body>
</html>
h1 {
color: #f00;
background-color: #00f;
}
p {
color: yellow;
background-color: green;
}