2011-01-23 77 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