Bootstrap:固定的排水沟宽度在流体布局中? [英] Bootstrap: Fixed gutter width in fluid layout?
问题描述
在使用流体布局时,我希望具有[left | content | right]和[left | content]或[content | right]等不同的布局,单元"之间的装订线也是流体的,并且具有百分比值.但是我想在左右区域和内容区域之间为排水沟设置一个固定的宽度,例如10px或20px.
I want to have different layouts like [left|content|right] and [left|content] or [content|right] when using the fluid layout the gutter between the "cells" is also fluid and has a percentage value. But I would like to have a fixed width for the gutter like 10px or 20px between the left/right and content areas.
任何建议如何使这项工作有效?我已经尝试过了,但最终总是遇到了变化很大的元素.
Any suggestion how to make this work? I've already tried it but ended always up with wildly shifting elements.
推荐答案
Answered a question like this before, what it basically came down too was creating a set of classes to offset the main container depending on how many sidebars you have, like so:
CSS
.fixed-fluid {
margin-left: 240px;
}
.fluid-fixed {
margin-right: 240px;
margin-left:auto !important;
}
.fixed-fixed {
margin: 0 240px;
}