HTML水平线

HTML 水平线标签 <hr> 用于在我们的段落之间插入一条水平线。例如,

  <p>First Paragraph</p>
  <hr>
  <p>Second Paragraph</p>

浏览器输出

HTML

<hr> 标签是一个空标签,即它不需要闭合标签。

HTML 水平线用于分隔页面部分

<hr> 标签用于在 HTML 中应用主题分隔。即,当主题发生变化或需要指定内容之间的分隔时使用它。通常,<hr> 标签用于文章中的部分之间。例如,

<h2>Physics</h2>
<p>Physics is the natural science that studies matter, its fundamental constituents, its motion and behavior through space and time, and the related entities of energy and force. </p>
<hr>
<h2>Chemistry</h2>
<p>Chemistry is the branch of science that deals with the properties, composition, and structure of elements and compounds, how they can change, and the energy that is released or absorbed when they change.</p>

浏览器输出

HTML

如您所见,我们还使用 <hr> 标签来分隔教程的各个部分。

我们的高级学习平台,凭借十多年的经验和数千条反馈创建。

以前所未有的方式学习和提高您的编程技能。

试用 Programiz PRO
  • 交互式课程
  • 证书
  • AI 帮助
  • 2000+ 挑战