下線の位置を指定する

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


text-underline-position: ***;

ブラウザ
(独自拡張) Internet Explorer5.5
参考
書式基本 要素名 クラス ID

text-underline-position は、下線の表示位置を指定するプロパティです。

このプロパティの値に above を指定すると、下線を文字の上(縦書きの場合は文字の右側)に表示することができます。

※下線の指定については text-decoration 、縦書きについては writing-mode をご覧ください。


p {
text-decoration: underline;
text-underline-position: above;
}


text-underline-position above … (文字の上、または右側に線を表示します)
below … (文字の下、または左側に線を表示します)

使用例

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

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

p {
writing-mode: tb-rl;
text-decoration: underline;

}

#example1 { text-underline-position: above; }
#example2 { text-underline-position: below; }


-->
</style>

</head>
<body>

<p>
<span id="example1">文字の右側に線を表示</span>
<br>
<span id="example2">文字の左側に線を表示</span>
</p>

</body>
</html>

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

文字の右側に線を表示
文字の左側に線を表示



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

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