2011-08-18 88 views
0

我有問題,使溢出隱藏,如果寬度超過 任何人都知道如何做到這一點?在IE中的CSS溢出問題

它根本不適用於IE。

<style type="text/css"> 
body{ 
    font-family:Calibri; 
    font-size:12pt; 
} 
table.excel { 
    border-collapse:collapse;  
    color:#000000; 
    font-weight:400; 
    font-style:inherit; 
    text-align:left; 
    vertical-align:bottom; 
    border:1px solid #C0C0C0; 
} 

.datacell { 
    border: 1px solid #C0C0C0; 
} 
</style> 

<table class="excel" width="194px"> 
    <tr> 
     <td style="width:30px;">&nbsp;</td> 
     <td style="width:64px;">A</td> 
     <td style="width:100px;">B</td> 
    </tr> 
    <tr> 
     <td style="height:50px;">1</td> 
     <td class="datacell" style="max-width:64px;"> 
      <div style="float:left;min-width:160px;white-space: nowrap; overflow: hidden; position:relative;background-color:#FFFFFF;">I like to eat McDonalds double<br>cheese burger, i am lovin it!</div> 
     </td>   
     <td class="datacell">aa</td> 
    </tr> 
</table> 
+0

你甚至沒有'overflow:hidden'在那裏的任何地方。 –

+0

他在'td.datacell> div'中。 –

回答

0

添加寬度高度屬性您溢出隱藏<div>

+0

我認爲它適用於firefox,chrome和safari,但它迄今爲止不適用於IE 8。 –

0

我嘗試在div的風格改變min-width:160px;width:160px; &它解決您的問題。