---
title: "width,heightwidth,heightwidth,height"
author: "chokee"
date: "2017-05-16T10:08:23Z"
tags: []
categories: ["编程语言"]
slug: "width-heightwidth-heightwidth-height"
draft: false
lastmod: "2017-05-16T13:51:46Z"
id: 2374604
url: "https://chokee.iteye.com/blog/2374604"
---

是不是显示器的分辨率啊。下面你自己选择：min-height  
   网页可见区域宽：document.body.clientWidth  
网页可见区域高：document.body.clientHeight  
网页可见区域宽：document.body.offsetWidth (包括边线的宽)  
网页可见区域高：document.body.offsetHeight (包括边线的宽)  
网页正文全文宽：document.body.scrollWidth  
网页正文全文高：document.body.scrollHeight  
网页被卷去的高：document.body.scrollTop  
网页被卷去的左：document.body.scrollLeft  
网页正文部分上：window.screenTop  
网页正文部分左：window.screenLeft  
屏幕分辨率的高：window.screen.height  
屏幕分辨率的宽：window.screen.width  
屏幕可用工作区高度：window.screen.availHeight  
屏幕可用工作区宽度：window.screen.availWidth  
  
// 最大高度随内容增加而增加。  
   你设置滚动条就是了。overflow:auto;  


 
alert($(window).height()); //浏览器当前窗口可视区域高度
 
alert($(document).height()); //浏览器当前窗口文档的高度
alert($(document.body).height());//浏览器当前窗口文档body的高度
alert($(document.body).outerHeight(true));//浏览器当前窗口文档body的总高度 包括border padding margin
alert($(window).width()); //浏览器当前窗口可视区域宽度
alert($(document).width());//浏览器当前窗口文档对象宽度
alert($(document.body).width());//浏览器当前窗口文档body的高度
alert($(document.body).outerWidth(true));//浏览器当前窗口文档body的总宽度 包括border padding margin