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

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

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-21 08:48:13
Original
2709 people have browsed it


我用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>
Copy after login
Copy after login

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>
Copy after login
Copy after login


你说的不行
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template