您可以使用<hr>标记创建水平规则或线条,以在视觉上分隔网页上的内容部分。像一样<br>,<hr>标记也是一个空元素。这是一个例子:
例试试这个代码»
<p>This is a paragraph.</p>
<hr>
<p>This is another paragraph.</p>
管理空白
通常,浏览器会通过按键盘上的空格键或Tab键将单个空格显示在HTML代码中创建的多个空格。通过按Enter键在HTML代码内部创建的多个换行符也显示为单个空格。
以下段落将显示在一行中,没有任何额外的空间:
例试试这个代码»
<p>This paragraph contains multiple spaces in the source code.</p>
<p>
This paragraph
contains multiple tabs and line breaks
in the source code.
</p>
插入 用于创建额外的连续空格,而插入<br>标记用于在网页上创建换行符,如以下示例所示:
例试试这个代码»
<p>This paragraph has multiple spaces.</p>
<p>This paragraph has multiple<br><br>line<br><br><br>breaks.</p>
如需转载,请注明文章出处和来源网址:http://www.divcss5.com/html/h60788.shtml