2011-10-22 63 views
0

我试图让下面的段落动态高度。试图让div增加td的高度的CSS问题

<td> 
    <b>audio systems</b> <br> 
    <div style="position:absolute"> 
     <p>Do you need services of a company that specialises in audio systems? With expertise in all areas of audio systems, AAVI is the best choice.</p> 
    </div> 
</td> 

我不能得到这个td动态增加高度段落内div标签。相反,它总是通过td部分,即使我为divp设置了宽度。我不想让p超过divtd部分。

有没有办法让我们这个工作?

+0

你可以尝试给td一个位置:相对的,但是没有看看你的css的其余部分,这很难说。如果你使用的是Chrome或Firebug,你可以做些什么,右击该段落并选择“检查元素”,你可以手动地调整CSS并查看结果。您可以勾选或取消样式规则以查看效果是什么。 – toon81

+1

考虑到HTML的这个有限的子集,它看起来像你试图使用表格来代替布局而不是语义,在这种情况下,你根本不应该使用表格。此外,请包括您的CSS! –

回答

0
<table> 
<tr> 
<td> 
    <b>audio systems</b> <br> 
    <div style="position:absolute"> 
    <p>Do you need services of a company that specialises in audio systems? With expertise in all areas of audio systems, AAVI is the best choice.</p> 
    </div> 
</td> 
</tr> 
</table> 

适合我。