2011-08-18 90 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; &它解决您的问题。