css - 移除响应式网站 HTML

标签 css html twitter-bootstrap twitter-bootstrap-3

<分区>


想改进这个问题吗? 通过 editing this post 添加细节并澄清问题.

关闭 4 年前

我正在为我的网站使用 Bootstrap 。但现在我不想要响应式网站。

我们可以禁用响应式网站吗?

如果是怎么办?

任何想法

非常感谢

最佳答案

Bootstrap documentation告诉您如何执行此操作。

  1. Omit the viewport mentioned in the CSS docs
  2. Override the width on the .container for each grid tier with a single width, for example width: 970px !important; Be sure that this comes after the default Bootstrap CSS. You can optionally avoid the !important with media queries or some selector-fu.
  3. If using navbars, remove all navbar collapsing and expanding behavior.
  4. For grid layouts, use .col-xs-* classes in addition to, or in place of, the medium/large ones. Don't worry, the extra-small device grid scales to all resolutions.

例如,添加此 CSS(在 Bootstrap CSS 之后):

.container {
    width: 970px !important;
}

然后只使用 col-xs-* 类。例如:

<div class="container">
    <div class="col-xs-6"></div>
    <div class="col-xs-6"></div>
</div>

.container {
    width: 970px !important;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js"></script>

<div class="container">
    <div class="col-xs-6">left</div>
    <div class="col-xs-6">right</div>
</div>

关于css - 移除响应式网站 HTML,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28289835/

上一篇:html - 悬停导航项上的下划线

下一篇:html - 在 Chrome 中重新绘制背景附件固定和背景大小覆盖的错误

相关文章:

javascript - 如何在只知道它的索引的情况下获得段落内单词的边界矩形?

html - Bootstrap 导航栏默认

html - CSS 仅动态 DIV 宽度,即。如果浏览器宽度允许,每行更多的 DIV

javascript - 全日历中的工具提示不起作用

html - 如果在移动设备上加载,页面底部的空间

html - 在页眉中心对齐 Logo

jQuery 滚动到滚动或 View 上的 div 顶部

jquery - Grails:如何在 Twitter Bootstrap 3 模式中重新初始化 AJAX 内容

javascript - 为什么 Chrome 和 Firefox 呈现的 bootstrap CSS 与 Safari 不同

html - 嵌套的DIV,如何让子真正在里面?