twitter-bootstrap Bootstrap 2.3.2 中带有响应式主 div 的固定宽度侧边栏

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/19541035/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-21 18:56:43  来源:igfitidea点击:

Fixed width sidebar with responsive main div in bootstrap 2.3.2

csstwitter-bootstrapresponsive-designfluid-layouttwitter-bootstrap-2

提问by sam

Im trying to get a fixed width side bar with a responsive main div when using bootstrap 2.3.2.

我试图在使用引导程序 2.3.2 时获得一个固定宽度的侧边栏和一个响应式主 div。

Something like this image below

像下面这张图

fixed sidebar, fluid main div

固定侧边栏,流体主div

Ived tried to use a 200pxfixed width div and then place a fluid div next to it, but couldnt get it to work. Any ideas ? ive made a js fiddle of the problem here - http://jsfiddle.net/KAfMB/1/

Ived 尝试使用200px固定宽度的 div,然后在它旁边放置一个流体 div,但无法让它工作。有任何想法吗 ?我在这里做了一个 js 问题 - http://jsfiddle.net/KAfMB/1/

采纳答案by Hai Nguyen

This is because your "fixed-span" class is being overridden by the bootstrap span classes. You can solve this removing the word "span" from your class:

这是因为您的“固定跨度”类被引导跨度类覆盖。你可以解决这个问题,从你的班级中删除“span”这个词:

<div class="row-fluid">
    <div class="fixed blue cols">...</div>
    <div class="span8 red cols">...</div>
</div>
.fixed {
    width:200px;
    float: left;
}

Here's the fiddle: http://jsfiddle.net/KAfMB/4/

这是小提琴:http: //jsfiddle.net/KAfMB/4/