<hr>
要素名 | 属性名 | 説明 | 非推奨 | 必須属性 |
---|---|---|---|---|
hr | 横罫線 | |||
align | 横方向の配置位置 | 非推奨 | ||
size | 太さ(ピクセル数) | 非推奨 | ||
width | 長さ(ピクセル数又は%) | 非推奨 | ||
noshade | 平面的に表示 | 非推奨 | ||
color | 色 | 非推奨 | ||
class | クラス名 | |||
id | ID名 | |||
title | 補足情報 | |||
style | スタイルシート | |||
lang | 言語コード | |||
dir | 文字表記の方向 |
hr要素は、Horizontal Ruleの略で水平の罫線を引きます。プラウザでは、引っ込んだ感じで立体的に表示されます。 noshade属性を指定すると単純な塗りつぶしの線になります。align属性は、水平方向の配置位置を指定し、 値にはleft ,center ,rightの何れかを指定します。size属性は、線の太さをピクセル数で指定し、width属性は、 線の長さをピクセル数又は%で指定します、%で指定した場合は、ウィンドの幅に対する割合になります。 color属性は、線の色をカラーコード又は色名で指定します。 ただし、これらの属性は、HTML4.01では非推奨です。スタイルシートを利用して下さい。
Sample
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html lang="ja">
<head>
<base href="http://www.abcd.com/efg/index.html">
<meta http-equiv="Content-Type" content="text/html; charset=shift_jis">
<meta http-equiv="Content-Style-Type" content="text/css">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<meta name="author" content="制作者名">
<meta name="description" content="内容の紹介">
<meta name="keywords" content="キーワード1,キーワード2,キーワード3,・・・">
<link rel="start" href="start.html">
<link rel="index" href="index.html">
<title>横罫線を入れる。</title>
</head>
<body>
<p>何も属性を指定しない横罫線です。</p>
<hr>
<p>size属性に15ピクセルを指定</p>
<hr size="15">
<p>size属性に15ピクセルを指定しnoshade属性を指定</p>
<hr size="15" noshade>
<p>size属性に15ピクセルを指定、width属性に50%を指定、color属性にredを指定</p>
<hr size="15" width="50%" color="red">
</body>
</html>
<html lang="ja">
<head>
<base href="http://www.abcd.com/efg/index.html">
<meta http-equiv="Content-Type" content="text/html; charset=shift_jis">
<meta http-equiv="Content-Style-Type" content="text/css">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<meta name="author" content="制作者名">
<meta name="description" content="内容の紹介">
<meta name="keywords" content="キーワード1,キーワード2,キーワード3,・・・">
<link rel="start" href="start.html">
<link rel="index" href="index.html">
<title>横罫線を入れる。</title>
</head>
<body>
<p>何も属性を指定しない横罫線です。</p>
<hr>
<p>size属性に15ピクセルを指定</p>
<hr size="15">
<p>size属性に15ピクセルを指定しnoshade属性を指定</p>
<hr size="15" noshade>
<p>size属性に15ピクセルを指定、width属性に50%を指定、color属性にredを指定</p>
<hr size="15" width="50%" color="red">
</body>
</html>
Internet Explorer8での表示例
