水平線の枠線を指定する

[新着] Webテンプレートを仮オープンしました


border: ***;

ブラウザ
Internet Explorer Netscape6 Firefox Opera
参考
書式基本 要素名 クラス ID

border は、枠線を指定するプロパティです。hr要素にこのスタイルを設定すると、色々なタイプの水平線を作ることができます。


hr {
border: 1px #ff0000 solid;
background-color: #ffdfe2;
height: 10px;

}


border 枠線(太さ、色、スタイル)を指定します

枠線の指定方法については、ボックスカテゴリーの「枠線」の項目をご覧ください。


使用例

<html>
<head>
<title>TAG index Webサイト</title>

<style type="text/css">
<!--

hr.example1 {
border: 1px #ff0000 solid;
background-color: #ffdfe2;
color: #ffdfe2;
height: 10px;

}

hr.example2 {
border-style: solid;
border-width: 2px;
border-color: #c40000 #ffdfe2 #ffdfe2 #c40000;
background-color: #ff8080;
color: #ff8080;
height: 10px;

}

hr.example3 {
border-style: dotted none none none;
border-top-width: 2px;
border-top-color: #ff0000;
height: 2px;
}


-->
</style>

</head>
<body>

<hr class="example1">

<hr class="example2">

<hr class="example3">


</body>
</html>

これをブラウザで見ると次のように表示されます






[特集] レンタルサーバー比較 & サーバー選びのチェックポイント

サイト内検索について - ベーシック版