太字テキストに strong タグを使用する
このステップでは、テキストを太字で表示する方法を学びます。<strong> タグは、テキストが強い重要性、真剣さ、または緊急性を持っていることを示すために使用されます。ブラウザは通常、<strong> タグ内のコンテンツを太字でレンダリングします。
前のステップで追加した段落を修正して、「important information」というフレーズを強調しましょう。このフレーズを <strong> と </strong> タグで囲みます。
index.html ファイルの <p> タグを次のように変更してください。
<p>
This is a paragraph of text. It contains some introductory information about
this page. HTML is great for structuring content, and this paragraph is an
example of that. It also contains some <strong>important information</strong>.
</p>
これで、ファイルの完全な <body> は次のようになります。
<body>
<h1>Welcome to My Web Page</h1>
<p>
This is a paragraph of text. It contains some introductory information about
this page. HTML is great for structuring content, and this paragraph is an
example of that. It also contains some
<strong>important information</strong>.
</p>
</body>
ファイルを保存し、「Web 8080」タブを確認してください。「important information」というテキストが太字になっていることに気づくでしょう。