2012-04-20 31 views
1

我正在使用<span>在弹出的div内显示一行地址,它在所有浏览器中都能正常工作,但在IE 8中(仅)它不工作跨度内容不能使用弹出式div跨度标签内的IE 8文本去除div

在弹出窗口div中,所有内容都使用表格显示,而td用宽度指定。

输出在其他浏览器

|------------------|<--DIV message 
|line1<--td1  | 
|line2<--td1  | 
|Here it goes the a|<--<tr><td>span</td></tr> 
|ddress not goes | 
| outside   | 
|__________________| 

输出IE8

|------------------|<--DIV message 
|line1<--td1  | 
|line2<--td1  | 
|Here it goes the a|ddress and it goes outside<--<tr><td>span</td></tr> 
|     | 
|__________________| 

的所有内容,包括跨度在所有的浏览器工作正常,但在IE8它去外面。在IE8中,它不会处理我分配给td的宽度。

HTML:

<div class="message"> 
<table> 
<tr> 
<td> 
<span>Here it goes the a|ddress and it goes outside</span> 
</td> 
</tr> 
</table> 
</div> 

CSS:

.message {width:320px;height:220px;} 
.message table td{width:80px;} 
.message table td span{width:80px;}//I tried like this it works in other browsers not in IE8 

回答

2

尝试像这样整流

.message table td span{width:80px; white-space:normal;} 
+0

+1问题 – krish 2012-04-20 12:20:57