text-overflow

書式

text-overflow:表示方法

対象

全ての要素

継承

する

初期値

clip

バージョン

独自プロパティ

対応ブラウザ

Win IE6.0以降

解説

はみ出した場合の表示処理を指定します。以下の値が指定できます。
設定名方法
clipクリップ(見えなく)する
ellipsis...で表示する
サンプルコード
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<title>Sample</title>
<style type="text/css"><!--
body { margin:0px; }
div { position:absolute; top:10;left:10px;
width:200px;
height:18px;
white-space:nowrap;
overflow:hidden;
text-overflow:ellipsis;
}
--></style>
</head>
<body>
<div>サンプルテキストです。長いと省略記号が表示されるはずですが。</div>
</body>
</html>
実際のサンプルを実行する