【发布时间】:2013-12-13 12:33:05
【问题描述】:
嗨,我有一个固定位置和 100% 宽度的标题,我还有一个从左侧滑出的侧边栏,它也是固定位置。问题是侧边栏与标题重叠,我希望标题在侧边栏滑出时与侧边栏一起缩小。我认为它会自然而然地做到这一点,因为它被设置为宽度 100%。然而事实并非如此。
有什么想法吗?
谢谢
标题
#header_wrapper{
width:100%;
height: 50px;
/*background-color: #dddddd;*/
background-color: #2a5f8c;
border-bottom: 2px solid #ffffff;
float: left;
position: fixed;
z-index: 80;
border-bottom: 1px solid #444444;
}
侧边栏
#category_wrapper{
width: 200px;
height: 100%;
position: fixed;
float: left;
border-right: 3px solid #333;
display: none;
}
jQuery
$("#header_category").click(function () {
$('#category_wrapper').toggle(200);
});
HTML
<div id="category_wrapper"></div><!--end category_wrapper-->
<div id="header_wrapper"></div><!--end header_wrapper-->
【问题讨论】:
-
你的 HTML 看起来怎么样?
-
刚刚在原帖中添加了
标签: javascript jquery html css