Home >Web Front-end >HTML Tutorial >bootstrap如何设置当网页宽度小于XXX 时 不做自适应布局 显示出滚动条 不然网页都变形了_html/css_WEB-ITnose

bootstrap如何设置当网页宽度小于XXX 时 不做自适应布局 显示出滚动条 不然网页都变形了_html/css_WEB-ITnose

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-21 08:48:132679browse


我用bootstrap做自适应布局 可是当网页宽度太小了 整个网站就变形了

请问如何实现当网页宽度小于指定宽度时候 取消bootstrap的自适应布局    并且显示底部滚动条 防止网页变形 如何设置 能否给我个demo


回复讨论(解决方案)

2种办法实现,一个是css3属性media query,另外一个是js添加事件监听 

<style type="text/css">    .min-800{ width:800px;}</style><script>    window.onresize = function(){        var win = $(window).width(),            main = $('#main');        if(win < 800){            main.addClass('min-800');        }    }</script>

2种办法实现,一个是css3属性media query,另外一个是js添加事件监听 

<style type="text/css">    .min-800{ width:800px;}</style><script>    window.onresize = function(){        var win = $(window).width(),            main = $('#main');        if(win < 800){            main.addClass('min-800');        }    }</script>


你说的不行
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn