jQuery-UI选项卡有css float问题

Bik*_*ter 4 jquery-ui css-float

我遇到了jQueryUi Tabs的问题.我想在选项卡视图的左侧有一个导航栏,但布局不起作用.我认为这是一个bug,我会将它报告给jQuery,但首先我想知道你是否可以确认这是一个bug,还是我做错了什么?

在[ http://public.virtualmischa.de/bugs/jqueryui-tabslayout.html ]上预览我的示例.

首先,您将看到非工作选项卡示例,并在工作标准浮动div示例下方.

<!DOCTYPE html> 
<html> 
<head> 
  <title>JQuery Tablayout problems</title>
  <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.11/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"> 
  <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script> 
  <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.11/jquery-ui.min.js"></script> 
  <script type="text/javascript"> 
  $(document).ready(function () {
    $("#tabs").tabs();
  });
  </script>
</head>
<body>
<div style="float:left; width:200; color: red;height: 200px;">Where is my left bar?<br></div>
<div id="tabs"><ul><li><a href="#a1">A tab page</a></li></ul>
    <div id="a1">Do you see a red bar left of this tab view?</a></div>
</div>

<div style="float:clear"></div>

<div style="float:left; width:200; color: red;height: 200px;">Where is my left bar?<br></div>
<div id="no-tabs"><ul><li><a href="#a2">A tab page</a></li></ul>
    <div id="a2">Do you see a red bar left of this tab view?</a></div>
</div>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)

小智 5

这里的解决方案解决了我的问题,看起来有点像你的.查看 jquery ui tip floated divs以获取更多信息.

#yourTabsDiv {
  float:left;

  width: 100%;

}
Run Code Online (Sandbox Code Playgroud)