gpt4 book ai didi

css - Bootstrap 流体布局 - 侧边栏的固定宽度

转载 作者:技术小花猫 更新时间:2023-10-29 10:34:33 25 4
gpt4 key购买 nike

我有一个基于 Twitter bootstrap 的流畅布局。

<div class="container-fluid">
<div class="row-fluid">
<div class="span2">
<!--Sidebar content-->
</div>
<div class="span10">
<!--Body content-->
</div>
</div>
</div>

如果侧边栏的宽度固定,那就太好了。如果将布局从流体更改为“静态”并将侧边栏的宽度设置为

220px

然后我调整窗口大小或将分辨率更改为 1024...正文内容跳到侧边栏下方。我怎样才能避免这种情况?

编辑:知道了。稍后将发布我的“解决方案”。感谢您的回复

最佳答案

我觉得你看起来像这样:

<div class="sidebar span4">
this is my fixed sidebar
</div>
<div class="main">
<div class="container-fluid">
<div class="row-fluid">
<div class="span2">this is fluid</div>
<div class="span3 offset1">yeah!</div>
<div class="span6">Awesome!</div>
</div>
<div class="row-fluid">
<div class="span6">1 half</div>
<div class="span6">2 half</div>
</div>
</div>
</div>

为方便起见,这里有一个 fiddle :http://jsfiddle.net/TT8uV/2/

一般说明:

You don´t need to use bootstrap as your 'main container', so you can place your sidebar side-by-side with a grid system (like bootstrap fluid and responsive). This way you have A LOT of control of the sidebar, without affecting the actual content.

希望它对你有用。

关于css - Bootstrap 流体布局 - 侧边栏的固定宽度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9589333/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com