這個標簽可以在屏幕上顯示一條水平線,用以分割頁面中的不同部分。
<hr>有三個屬性:
size 水平線的寬度
width 水平線的長,用占屏幕寬度的百分比或象素值來表示
align 水平線的對齊方式,有left right center三種
noshade 線段無陰影屬性,為實心線段
我們可以用幾個例子來說明這線段的用法:
線段粗細的設定
<html>
<head>
<title>線段粗細的設定</title>
</head>
<body>
<p>這是第一條線段,無size設定,取內定值size=1來顯示<br>
<hr />
<p>這是第二條線段,size=5<br>
<hr size=5>
<p>這是第三條線段,size=10<br>
<hr size=10>
</body>
</html>
線段長度的設定
<html>
<head>
<title>線段長度的設定</title>
</head>
<body>
<p>這是第一條線段,無width設定,取width內定值100%來顯示<br>
<hr size=3>
<p>這是第二條線段,width=50(點數方式)<br>
<hr width=50 size=5>
<p>這是第三條線段,width=50%(百分比方式)<br>
<hr width=50% size=7>
</body>
</html>
線段排列的設定
<html>
<head>
<title>線段排列的設定</title>
</head>
<body>
<p>這是第一條線段,無align設定,(取內定值center顯示)<br>
<hr width=50% size=5>
<p>這是第二條線段,向左對齊br>
<hr width=60% size=7 align=left>
<p>這是第三條線段,向右對齊<br>
<hr width=70% size=2 align=right>
</body>
</html>
無陰影的設定
<html>
<head>
<title>無陰影的設定</title>
</head>
<body>
<p>這是第一條線段,無noshade設定,取內定值陰影效果來顯示<br>
<hr width=80% size=5>
<p>這是第二條線段,有noshade設定<br>
<hr width=80% size=7 align=left noshade>
</body>
</html>
最后一個水平線:
新聞熱點
疑難解答