如何自定义引导列宽度? [英] How to Customize Bootstrap Column Widths?

查看:103
本文介绍了如何自定义引导列宽度?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这个,但我觉得4是太大的我的侧边栏宽度和3是太小(它必须加起来12)。

I have this, but I feel 4 is too big for my sidebar width and 3 is too small (it has to add up to 12).

  <div class="col-md-8">
  <div class="col-md-4">

我尝试了但是不工作:

  <div class="col-md-8.5">
  <div class="col-md-3.5">

是否有另一种方法获得类似的结果?

Is there another way to get a similar outcome?

感谢您的帮助!

推荐答案

要扩展@ isherwood的答案,这里是创建自定义 -sm - 宽度在Bootstrap 3.3中

To expand on @isherwood's answer, here is the complete code for creating custom -sm- widths in Bootstrap 3.3

一般来说,你要搜索一个现有的列宽度$ c> col-sm-3 ),并将适用于它的所有样式(包括通用样式)复制到您定义新列宽的自定义样式表。

In general you want to search for an existing column width (say col-sm-3) and copy over all the styles that apply to it, including generic ones, over to your custom stylesheet where you define new column widths.

.col-sm-3half, .col-sm-8half {
    position: relative;
    min-height: 1px;
    padding-right: 15px;
    padding-left: 15px;
}

@media (min-width: 768px) {
    .col-sm-3half, .col-sm-8half {
        float: left;
    }
    .col-sm-3half {
        width: 29.16666667%;
    }
    .col-sm-8half {
        width: 70.83333333%;
    }
}

这篇关于如何自定义引导列宽度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆