CSSスタイルシートの使用
これを変える:
<link rel="stylesheet" href="">
これに:
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
スタイルシートを使用するには、スタイルを設定するHTML要素にクラスを追加する必要があります。
<div class="w3-container w3-black">
<h1>This is a Heading</h1>
<p>This is a paragraph.</p>
<p>This is another paragraph.</p>
</div>
HTML / CSSスケルトン
<!DOCTYPE html>
<html lang="en">
<meta charset="UTF-8">
<title>Page Title</title>
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
<style>
</style>
<script src=""></script>
<body>
<img src="img_la.jpg" alt="LA" style="width:100%">
<div class="w3-container w3-black">
<h1>This is a Heading</h1>
<p>This is a paragraph.</p>
<p>This is another paragraph.</p>
</div>
</body>
</html>
「自分で試してみてください」ボタンをクリックして、どのように機能するかを確認してください。
コンテナの背景色を青緑色から黒に変更してみてください。
できましたか?
おめでとう!
スタイルシートの基本的な使い方を学びました。
読み続けてください!
レスポンシブになる方法
HTMLコード
<div class="w3-row">
<div class="w3-third">
<img src="img_avatar.png" alt="Name1" style="width:100%">
</div>
<div class="w3-third">
<img src="img_avatar.png" alt="Name2" style="width:100%">
</div>
<div class="w3-third">
<img src="img_avatar.png" alt="Name3" style="width:100%">
</div>
</div>
カードの作成方法
本当に進んだものの準備はできていますか?
HTMLの名刺はどうですか?
画像とテキストの両方を含みます。
Play with the code below for a while, until you think you got a grip on it.
After that, we will start coding really fantastic HTML pages.
John Doe
Engineer
HTML Code
<div class="w3-card" style="width:200px">
<img src="img_avatar.png" style="width:100%">
<div class="w3-container w3-center">
<p class="w3-xlarge">John Doe</p>
<p>Engineer</p>
</div>
</div>