表内的CSS问题试图让div增加td的高度

时间:2011-10-22 14:46:07

标签: html 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标记内段落的高度。相反,即使我为tddiv设置了宽度,它总是会越过p部分。我不希望p超过divtd部分。

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

2 个答案:

答案 0 :(得分:0)

仅删除position:absolute;或使用JavaScript。

使<div>绝对定位removes it from the normal flow

答案 1 :(得分: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>

适合我。