使用 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" 现在是粗体显示的。