オーバーフローしたときに省略記号を付ける必要がある内部コンテンツを持つdivがあります。私は他の要素についてこれを何回もやったことがありますが、何らかの理由でこれが期待どおりに動作していません。CSSテキストオーバーフローの省略記号が表示されない
また、white-space:nowrap;
は、コンテンツがスパン内の次の行に折れないため、私は省略記号が始まる前に2-3ワードしか表示されないため、意図的に出力されませんでした。テキストを親コンテナの高さ全体に広げ、その境界を越えて存在するコンテンツの省略記号を開始したいと思います。ここで
は、作業のデモです:http://jsfiddle.net/sadmicrowave/DhkSA/
CSS:
.flow-element{
position:absolute;
font-size:12px;
text-align:center;
width:75px;
height:75px;
line-height:70px;
border:1px solid #ccc;
}
.flow-element .inner{
position:absolute;
width:80%;
height:80%;
border:1px solid blue;
top:0px;
bottom:0px;
left:0px;
right:0px;
margin:auto;
text-align:center;
}
.flow-element .long{
float:left;
height:50px;
width:100%;
line-height:12px;
border:1px solid red;
text-overflow:ellipsis;
overflow:hidden;
}
HTML:
<a class='flow-element' style='top:100px; left:50px;'>
<div class='inner'>
<span class='long'>Box 1 and some other content that should wrap and do some other stuff</span>
</div>
</a>
誰かが助けてください。私は事前
これは絶対に間違っています。インライン要素でとてもうまく動作します。 –
なぜこのw3cドラフトは、ブロックのみに適用されると言いますか? http://dev.w3.org/csswg/css3-ui/#text-overflow –
またこの回答を確認http://stackoverflow.com/a/9924984/1237812 –