Bootstrap 手机屏幕自适应的响应式布局开关
来源:互联网 发布:java web.xml配置详解 编辑:程序博客网 时间:2024/06/11 19:45
Bootstrap提供了一套响应式布局的解决方案。但是有时候我们需要自己控制是否需要这个响应式布局。
在3.x的bootstrap里面,如果想要开启,需要添加下面的东西:
<head><meta name="viewport" content="width=device-width, initial-scale=1.0">
如果移动设备浏览器里,屏幕太大的话,缩放影响效果,可以禁用缩放。就是再加上 user-scalable=no这个标签。
<head><meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
如果你想关闭它,官网是这么写的。
- Omit the viewport
<meta>
mentioned in the CSS docs - Override the
width
on the.container
for each grid tier with a single width, for examplewidth: 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. - If using navbars, remove all navbar collapsing and expanding behavior.
- 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.
You'll still need Respond.js for IE8 (since our media queries are still there and need to be processed). This disables the "mobile site" aspects of Bootstrap.
其实核心就在于第二步,给整个body的style设置一个width,这样就覆盖掉之前的自响应布局的设置了。
- Bootstrap 手机屏幕自适应的响应式布局开关
- bootstrap实现导航栏的响应式布局,当在小屏幕、手机屏幕浏览时自动折叠隐藏
- 移动端开发-WebApp-淘宝商城(响应式布局:任何手机屏幕尺寸自适应)
- bootstrap响应式布局
- bootstrap响应式布局
- BootStrap响应式布局
- bootstrap:响应式布局
- bootstrap响应式布局的控制原理
- bootstrap响应式布局的实用类
- Bootstrap 响应式布局的实体类
- 响应式布局跟自适应布局的不同总结
- 响应式布局,宽度自适应
- Bootstrap 响应式布局模板
- Bootstrap禁用响应式布局
- Bootstrap禁用响应式布局
- bootstrap响应式布局注意
- Bootstrap 响应式网格布局
- 自适应网页(响应式布局)+弹性布局
- linux常用命令
- 调用函数进行变量的交换
- document.frames不兼容火狐的问题
- 对汉诺塔递归算法的研究
- A. Beautiful Year
- Bootstrap 手机屏幕自适应的响应式布局开关
- ExportToExcel 一个通用的把dataset导出至EXCEL的类
- 使用 Visual C# .NET 将字符串转换为小写、大写或词首字母大写
- 广州.Net培训课程哪里好,非传智播客莫属了
- 移植SlidingMenu Android library,和安装example出现的问题解决
- Digression:The perceptron learning algorithm(感知机学习算法)
- 做web开发有段时间了,想总结一下
- Android文档学习06_网络2
- 重构元编程