Home  >  Article  >  Web Front-end  >  怎么让html页面大小随浏览器改变而改变_html/css_WEB-ITnose

怎么让html页面大小随浏览器改变而改变_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-21 08:46:442726browse

怎么让html页面大小随浏览器改变而改变 


回复讨论(解决方案)

宽度用百分比,或者用css 框架。

可以说得具体一点吗,我在body和div里试了还是不行

把你不行的代码贴出来我瞧瞧

或者用哪些css ui框架!像bootstrap

楼主你的body标签哪去了

窗口缩小登录部分就往下移

body可以加上的,现在主要是怎么能解决窗口缩小页面也缩小,不乱就行

拜托了。。。

左右结构,当浏览器宽度比那两个元素加起来的宽度还小时当然下去。你需要学习一下bootstrap的栅格

暂时没有时间去学啊,现在急着把这个弄好

有你搞好这个的时间你也学会bootstrap了。你的css 基础不改恭维

var maxHeight, maxWidth, realHeight, realWidth, menuHeight;
            if ($.browser.msie) {
                maxHeight = $(window).height();
                maxWidth = $(window).width();

            } else {
                maxHeight = $(document.body)[0].clientHeight;
                maxWidth = $(document.body)[0].clientWidth;
            }

            //$("#tabbox").width(maxWidth - 100);
            if (window.innerHeight)
                winHeight = window.innerHeight;
            else if ((document.body) && (document.body.clientHeight))
                winHeight = document.body.clientHeight;
            if (document.documentElement && document.documentElement.clientHeight && document.documentElement.clientWidth) {
                winHeight = document.documentElement.clientHeight;
            }

调试的时候根据不同的高度和宽度,alert一下高度 就知道是否随浏览器大小获取不同的高宽

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