2011-01-23 74 views
2

我想让jquery手风琴正常工作在另一个div /表下,设置为float:right旁边的另一个表是float:leftjQuery手风琴和CSS浮动

每当我这样做,h3的整个长度和内容就会出现问题。

我也试过使用“填充空间”功能,根本没有帮助。

有没有人用过float的手风琴影响?

感谢,

<script> 
$(function() { 
    $("#accordion").accordion(); 
}); 
</script> 

<table border="0" cellpadding="0" cellspacing="0" style="width:380px;float:left;"> 
<tr><td>some text</td><td>some more text</td></tr> 
<tr>some text</td><td>some more text</td></tr> 
</table> 

      <div id="attendance_accordion" style="float:right;width:350px;"> 
       <h3><a href="#">Section 1</a></h3> 
       <div> 
        <p> 
         Section 1 text 
        </p> 
       </div> 
       <h3><a href="#">Section 2</a></h3> 
       <div> 
        <p> 
        Section 2 text 
        </p> 
       </div> 
       <h3><a href="#">Section 3</a></h3> 
       <div> 
        <p> 
        Section 3 text 
        </p> 
       </div>  
      </div> 

回答

5

如果你能请把你的标记和你的CSS,使我们可以看到它是如何做。

作为一个快速评估,当你有浮动元素时,确保在所有浮动元素之后使用“clear:both”。你可以把这个"<div style="clear:both">"结束。

+0

编辑我的问题,添加div虽然没有帮助.. – 2011-01-23 10:27:19