cssスタイルでの省略表示
872 ワード
<style>
.test_demo_clip{text-overflow:clip; overflow:hidden; white-space:nowrap; width:200px; background:#ccc;}
.test_ellipsis{text-overflow:ellipsis; overflow:hidden; white-space:nowrap; width:200px; background:#ccc;}
</style>
</head>
<body>
<!-- -->
<div class="test_demo_clip">
abcedfsafsafaaabcedfsafsafaaabcedfsafsafaaabcedfsafsafaaabcedfsafsafaaabcedfsafsafaaabcedfsafsafaa
</div>
<div class="test_ellipsis">
abcedfsafsafaaabcedfsafsafaaabcedfsafsafaaabcedfsafsafaaabcedfsafsafaaabcedfsafsafaaabcedfsafsafaa
</div>
注意:(
text-overflow:ellipsis; overflow:hidden; white-space:nowrap;
)の3つの属性は必ず一緒に使用します.