水平線の背景に画像を使う

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


background-image: url(***);

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

background-image は、背景画像を指定するプロパティです。hr要素にこのスタイルを設定すると、水平線の背景に画像を表示することができます。


hr {
background-image: url(image/back.gif);
height: 10px;
}


background-image 表示させたい画像ファイルを指定します

background-repeatbackground-position なども指定することができます。


使用例

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

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

hr.example1 {
background-image: url(image/back1.gif);
height: 14px;
}

hr.example2 {
background-image: url(image/back2.gif);
height: 14px;
background-color: #e2f5e0;
background-repeat: no-repeat;
background-position: right;

}


-->
</style>

</head>
<body>

<hr class="example1">

<hr class="example2">


</body>
</html>

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





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

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