如何禁用Twitter Bootstrap 3或强制一定的大小?

时间:2015-09-02 10:44:58

标签: twitter-bootstrap-3

我搜索了一下,发现了一个使用元标记的建议,但是<meta name="viewport" content="width=1200">但这样做有效。无论屏幕(文档)大小如何,如何强制显示某个布局?

我需要在框架中嵌入各种网站内容以进行CRM预览,我会以编程方式禁用页眉和页脚以节省空间 - 但是引导程序会显示TABLET布局版本......这会在iframe中占用太多空间。

我只是希望它显示完整尺寸lg布局,无论文档大小是多少。

1 个答案:

答案 0 :(得分:1)

要在引导程序中禁用响应,您必须执行其他步骤

最重要的是2号

  

禁用响应式视图的步骤

     

要禁用自适应功能,请按以下步骤操作。请在下面的修改后的模板中查看它。

     
      
  1. 删除(或只是不添加)CSS docs中提到的视口
  2.   
  3. 删除所有网格层的.container上的最大宽度,使用max-width:none!important;并设置宽度的常规宽度:970px;。确保这是在默认的Bootstrap CSS之后。您可以选择使用媒体查询或某些selector-fu。
  4. 来避免使用!important   
  5. 如果使用导航栏,请撤消所有导航栏折叠和展开行为(此处显示的内容太多,请仔细查看示例)。
  6.   
  7. 对于网格布局,除了中/大类之外,还应使用.col-xs- *类。别担心,超小型设备网格可以扩展到所有分辨率,因此您可以在那里设置。
  8.         

    您仍然需要针对IE8的Respond.js(因为我们的媒体查询仍然存在且需要被接收)。这只会禁用&#34;移动网站&#34; Bootstrap。

Disable responsiveness

Addtionally

一些元素不会被固定宽度。 - See the none responsive demo here

要更改额外的大小调整,在您的情况下,您似乎不需要编辑LESSSASS文件。

您需要通过编辑变量。file来更改断点,方法是将它们全部设为1200px或其他东西。

//== Media queries breakpoints
//
//## Define the breakpoints at which your layout will change, adapting to different screen sizes.

// Extra small screen / phone
//** Deprecated `@screen-xs` as of v3.0.1
@screen-xs:                  480px;
//** Deprecated `@screen-xs-min` as of v3.2.0
@screen-xs-min:              @screen-xs;
//** Deprecated `@screen-phone` as of v3.0.1
@screen-phone:               @screen-xs-min;

// Small screen / tablet
//** Deprecated `@screen-sm` as of v3.0.1
@screen-sm:                  768px;
@screen-sm-min:              @screen-sm;
//** Deprecated `@screen-tablet` as of v3.0.1
@screen-tablet:              @screen-sm-min;

// Medium screen / desktop
//** Deprecated `@screen-md` as of v3.0.1
@screen-md:                  992px;
@screen-md-min:              @screen-md;
//** Deprecated `@screen-desktop` as of v3.0.1
@screen-desktop:             @screen-md-min;

// Large screen / wide desktop
//** Deprecated `@screen-lg` as of v3.0.1
@screen-lg:                  1200px;
@screen-lg-min:              @screen-lg;
//** Deprecated `@screen-lg-desktop` as of v3.0.1
@screen-lg-desktop:          @screen-lg-min;