css - 使用 Bootstrap 3 在 cols 之间添加边距

标签 css twitter-bootstrap responsive-design twitter-bootstrap-3

我在将 margin-right 应用到我的 article.col-sm-8 时遇到问题,因为如果将(例如)10px 添加到 margin-right,我的 aside.col-sm-4 将放在文章下方,而我不会不要这个,我想把我放在文章旁边。

我的html结构

<body>
<div id="wrapper">
    <section class="row">
        <article class="col-sm-8">

        </article>
        <aside class="col-sm-4">

        </aside>
    </section>
</div>
</body>

我的包装器有最大宽度:1000px;

文章无边距布局

enter image description here

文章右边距的布局

enter image description here

我想要这个,给文章添加边距

enter image description here

希望你能帮助我,问候!!

最佳答案

Bootstrap 3 使用填充而不是边距来创建列之间的间距(装订线),因此如果您在 aside div 中使用 div,您将看到装订线。

因为你希望它是 10px 你可以在 articleaside 的两边设置 5px 的填充...

http://bootply.com/130020

关于css - 使用 Bootstrap 3 在 cols 之间添加边距,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23070927/

相关文章:

twitter-bootstrap - 让 Bootstrap Glyphicons 与 Webpack 一起工作

jquery - 背景感知文本颜色

css - 颜色数学 : effect of transparent black overlay on lightness

javascript - 如何从 Bootstrap 获取移动下拉菜单?

css - 选择按钮时选择单选按钮列表的容器

html - 在 col-1 下划分 bootstrap 列

android - HTML 电子邮件在 Gmail 应用程序中看起来不同

css - 如何将 collapse toggle bootstrap 放在 float-right 和 top 一切之上?

CSS 图像 url 在 IE 中无法正确呈现

css - 如何防止包含的 LESS 文件像 SCSS 那样自行编译?