2 つの「列」を含む 1 行の「行」が必要です。最初の「列」は流動的で、はみ出すテキストをカットする必要があります。
以下の例は、Webkit ブラウザー (Chromium、Safari) では完全に機能しますが、Firefox や Opera では機能しません。
すべてのブラウザで機能するソリューションを知っている人はいますか?
http://jsfiddle.net/fluidblue/YV3s9/
HTML:
<div class="header">
<div class="clickable">
<div class="description">
Some very very very very very very very very very very long description
</div>
</div>
<div class="buttons">
<a href="#">Link1</a>
<a href="#">Link2</a>
</div>
</div>
<div class="content">
Text below
</div>
CSS:
*
{
margin:0;
padding:0;
}
.header
{
background-color: gray;
display: table;
width: 100%;
}
.clickable
{
background-color: green;
display: table-cell;
width: 100%;
position: relative;
cursor: pointer;
}
.description
{
width: 100%;
position: absolute;
top:0;
left:0;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.buttons
{
background-color: red;
display: table-cell;
white-space: nowrap;
}
編集:web2008で提案されているように上、左を追加