我在我的页面中使用 JQuery 选项卡,并成功地使用一些借用的 CSS 设置/脚本将选项卡放置在内容下方。
我的页面左侧有一个侧栏,页面顶部有一个菜单横幅。然后,内容会出现在顶部菜单横幅和底部的选项卡面板之间。
我注意到我的页面底部有一个小的空白区域,导致显示垂直滚动条。我想删除这个空间(和滚动),需要专家的帮助。
我知道空间是由我的内容的选项卡部分引起的,因为我在其他主要元素上使用了萤火虫和消除技术,并且空间仅在我引入选项卡时出现。
我已将 CSS 填充、边距和边框宽度设置为零,但仍然可以看到空间。
这是我的 HTML、CSS 和脚本:
<head>
<title>Rfq</title>
<%= stylesheet_link_tag "rfq.css" %>
<%= javascript_include_tag :defaults %>
<%= javascript_include_tag "jquery-ui-1.8.10.custom.min.js" %>
<%= javascript_include_tag "rfq.js" %>
<%= csrf_meta_tag %>
</head>
<body>
<!--the top menu bar-->
<div id="rfq_menu_bar" class="ui-widget-header">Request for quote...</div>
<!--the side bar collapsed-->
<div id="rfq_side_bar_collapsed" class="ui-tabs-nav ui-state-active" >
</div>
<!--the tab panels-->
<div id=rfq_tabs_parent class="ui-widget-content">
<div id="rfq_main_tabs" class="tabs-bottom ui-widget-content">
<ul>
<li><a class="rfq_main_tab" id="items_tab" href="#rfq_items_panel">RFQ Items</a></li>
<li><a class="rfq_main_tab" id="reports_tab" href="#rfq_reports_panel">RFQ Reports</a></li>
</ul>
<div class="rfq_tab_content" id="rfq_items_panel">bob</div>
<div class="rfq_tab_content" id="rfq_reports_panel">jane</div>
</div>
</div>
</body>
还有我的 CSS:
html, body {
margin: 0;
padding: 0;
height: 100%;
font-family: Verdana, Sans-serif;
font-size: 10px;
position: relative;
border-width:0;
}
#rfq_users_table_wrapper {
width: 100%;
left:0;
top:0;
position: absolute;
margin: 0;
padding: 0;
}
#rfq_menu_bar {
margin: 0;
padding: 0;
height: 8%;
font-family: Sans-serif;
font-size: 20px;
left:0;
width:100%;
border-width:0;
}
#rfq_side_bar_collapsed {
margin: 0;
padding: 0;
float: left;
height:92%;
width:2%;
border-width:0;
}
#rfq_main_tabs {
height:100% !important;
padding: 0;
margin: 0;
border-width: 0;
}
.ui-button-text
{
font-size: 10px;
}
#rfq_tabs_parent {
position:absolute;
left:2%;
width:98%; !important;
height: 92% !important;
z-index: -2000;
margin: 0;
padding: 0;
border-width:0;
}
#rfq_items_panel {
padding: 0;
margin: 0;
border-width:0;
}
#rfq_reports_panel {
padding: 0;
margin: 0;
border-width: 0;
}
.rfq_tab_content {
height:100% !important;
width:100% !important;
padding: 0;
margin: 0;
}
.tabs-bottom {
position: relative;
padding: 0;
margin: 0;
}
.tabs-bottom .ui-tabs-panel {
height: 120px;
overflow: auto;
}
.tabs-bottom .ui-tabs-nav {
position: absolute !important;
left: 0;
bottom: 0;
right:0;
padding: 0 0.2em 0.2em 0;
}
.tabs-bottom .ui-tabs-nav li {
margin-top: -1px !important;
margin-bottom: 3px !important;
border-top: none;
border-bottom-width: 1px;
}
.ui-tabs-selected {
margin-top: -3px !important;
}
我的Javascript:
// 将标签放置在内容的底部:
$( ".tabs-bottom .ui-tabs-nav, .tabs-bottom .ui-tabs-nav > *" )
.removeClass( "ui-corner-all ui-corner-top" )
.addClass( "ui-corner-bottom" );