- 浏览: 176982 次
- 性别:
- 来自: 福建
最新评论
-
卡殿Love:
你好! 谢谢你的文章让我知道其中的原因,目前正在做手机端上的项 ...
web手机开发(iPhone和Andriod)关于position:fixed 属性的讨论
html代码:
<div style="width: 150px;height:20px;float: left;border: 2px solid red;margin: 10px;margin: 10px;padding: 10px;" id="test">jjjjj</div>
js代码:
alert($("#test").height());
alert($("#test").innerHeight());
alert($("#test").outerHeight());
alert($("#test").outerHeight(true));
结果:
在ie中的结果:17px,37px,41px,61px
在ff中的结果:20px,40px,44px,64px
html代码:
<div style="width: 150px;height: 41px;float: left;border: 2px solid red;margin: 10px;margin: 10px;padding: 10px;" id="test">jjjjj</div>
js代码:
alert($("#test").height());
alert($("#test").innerHeight());
alert($("#test").outerHeight());
alert($("#test").outerHeight(true));
结果:
在ie中的结果:17px,37px,41px,61px
在ff中的结果:41px,61px,65px,85px
html代码:
<div style="width: 150px;height: 42px;float: left;border: 2px solid red;margin: 10px;margin: 10px;padding: 10px;" id="test">jjjjj</div>
js代码:
alert($("#test").height());
alert($("#test").innerHeight());
alert($("#test").outerHeight());
alert($("#test").outerHeight(true));
结果:
在ie中的结果:18px,38px,42px,62px
在ff中的结果:42px,62px,66px,86px
html代码:
<div style="width: 150px;height: 60px;float: left;border: 2px solid red;margin: 10px;margin: 10px;padding: 10px;" id="test">jjjjj</div>
js代码:
alert($("#test").height());
alert($("#test").innerHeight());
alert($("#test").outerHeight());
alert($("#test").outerHeight(true));
结果:
在ie中的结果:36px,56px,60px,80px
在ff中的结果:60px,80px,84px,104px
结论:在ie中height包含border和padding并且height最小值为17px ,同理可得width,不过它最小值为15px
<div style="width: 150px;height:20px;float: left;border: 2px solid red;margin: 10px;margin: 10px;padding: 10px;" id="test">jjjjj</div>
js代码:
alert($("#test").height());
alert($("#test").innerHeight());
alert($("#test").outerHeight());
alert($("#test").outerHeight(true));
结果:
在ie中的结果:17px,37px,41px,61px
在ff中的结果:20px,40px,44px,64px
html代码:
<div style="width: 150px;height: 41px;float: left;border: 2px solid red;margin: 10px;margin: 10px;padding: 10px;" id="test">jjjjj</div>
js代码:
alert($("#test").height());
alert($("#test").innerHeight());
alert($("#test").outerHeight());
alert($("#test").outerHeight(true));
结果:
在ie中的结果:17px,37px,41px,61px
在ff中的结果:41px,61px,65px,85px
html代码:
<div style="width: 150px;height: 42px;float: left;border: 2px solid red;margin: 10px;margin: 10px;padding: 10px;" id="test">jjjjj</div>
js代码:
alert($("#test").height());
alert($("#test").innerHeight());
alert($("#test").outerHeight());
alert($("#test").outerHeight(true));
结果:
在ie中的结果:18px,38px,42px,62px
在ff中的结果:42px,62px,66px,86px
html代码:
<div style="width: 150px;height: 60px;float: left;border: 2px solid red;margin: 10px;margin: 10px;padding: 10px;" id="test">jjjjj</div>
js代码:
alert($("#test").height());
alert($("#test").innerHeight());
alert($("#test").outerHeight());
alert($("#test").outerHeight(true));
结果:
在ie中的结果:36px,56px,60px,80px
在ff中的结果:60px,80px,84px,104px
结论:在ie中height包含border和padding并且height最小值为17px ,同理可得width,不过它最小值为15px
发表评论
-
CSS强制性换行
2013-05-22 13:52 757一般情况下,元素拥有 ... -
最小高度的定义
2011-03-18 10:33 952height:auto !important;IE6不可以识别 ... -
flash wmode参数详解
2010-10-29 10:50 829在做web开发中可能会遇到flash遮挡页面中元素的情况,无论 ... -
CSS 过滤器 兼容ie,火狐和谷歌
2010-10-28 10:58 3593这篇汇总主要是提供一些CSS不透明的详细介绍,代码示例和解释, ... -
合并图片工具
2010-06-05 08:27 903不错的合成图片的工具,还提供css样式 -
关于line-height设置
2010-03-12 14:08 1103一个小小属性就有那么多的学问,我们来一起了解一下关于line- ... -
区别IE6,IE7,IE8,FF
2010-02-27 13:53 1041区别IE6,IE7,IE8,FF 【区别符号】:「\9」、「 ... -
在ie6下出现“无法打开该地址,浏览器停止服务”的bug
2010-01-04 13:48 724曾经在开发中遇到两次,原因是某个标签没有闭合。 -
IE6下某些中文注释引发的css样式全乱 | IE6下PNG背景图片透明问题
2009-12-08 15:55 2364IE6下如果line-height超出本身区块的height高 ... -
!important认识
2009-12-08 15:07 969在设计《网页设计师》 ... -
删除div中默认的高度(在ie中)
2009-11-03 17:20 1364<div style='width:100%;heigh ... -
去除和隐藏点击链接时出现的虚线框
2009-10-23 15:53 1268如何去除点击链接时出现的虚线框 有时候在一个页面用到收放功能 ... -
浮层浮动在select的标签上
2009-10-23 09:35 1070例如 <!-- ------------上传大附件 ... -
浮层的移动
2009-10-23 09:30 702使用 <script type="text/ ... -
1000张网页常用图片
2009-06-08 17:13 1988好东东,1000张网页常用图片 -
1000个网页小图标
2009-06-08 17:12 3661好东东,1000个网页小图标 -
50张Flash小图片
2009-06-08 17:11 1273好东西,50张Flash小图片 -
如何插入flash
2009-06-08 17:00 655<object classid="clsid: ... -
在静态图片特定位置做链接
2009-06-08 16:57 814<img src="file:///C|/Do ... -
如何让一个表单中的文本框中的文字垂直居中?
2009-06-08 16:46 1580如果用行高与高度的组在FF中是没有效果的,办法就是定义上下补白 ...
相关推荐
主要介绍了jQuery中的height innerHeight outerHeight的区别,需要的朋友可以参考下
主要介绍了jQuery height()、innerHeight()、outerHeight()函数的区别详解,需要的朋友可以参考下
jquery中有三个获取element高度的方法,分别是:height(),innerHeight(),outerHeght(bool);同样对应的有三个获取element宽度的方法:width(),innerHeight(),outerHeight(bool),这三个方法分别对应怎样的元素属性,如下...
NULL 博文链接:https://onestopweb.iteye.com/blog/2359446
$(选择器).height() | innerHeight() | outerHeight() 其中宽和高分别有三个方法: width()和 height()是指元素里面内容的宽高; innerWidth()和 innerHeight()是指元素里面内容的宽高加上内边距的宽高; outerWidth...
7.3.7 outerHeight(options) 115 7.3.8 outerWidth(options) 116 8. 事件 116 8.1 页面载入 116 8.1.1 ready(fn) 116 8.2 事件处理 117 8.2.1 bind(type, [data], fn) 117 8.2.2 one(type, [data], fn) 122 8.2.3 ...
主要介绍了jQuery中innerHeight()方法用法,实例分析了innerHeight()方法的功能、定义及获取第一个匹配元素内部区域高度的使用技巧,需要的朋友可以参考下
outerHeight([soptions]) outerWidth([options]) 选择器 基本 #id element .class * selector1,selector2,selectorN 层级 ancestor descendant parent > child prev + next prev ~ siblings 基本 :...
代码如下:<!DOCTYPE html PUBLIC “-//W3C... <head> <title>jQuery的位置函数(offset(),innerWidth(),innerHeight(),outerWidth(),outerHeight(),scrollTop(),scrollLeft())小应用</title> <s
outerHeight(options) outerWidth(options) 选择器 基本 #id element .class * selector1,selector2,selectorN 层级 ancestor descendant parent > child prev + next prev ~ siblings 基本 :first :...
$.jQuery( selector [, context] ), .jQuery( element ), .jQuery( elementArray ), .jQuery( jQueryObject ), .jQuery( ) $.jQuery( html [, ownerDocument] ), .jQuery( html, props ) $.jQuery( fn ) jQuery ...
outerHeight(options) outerWidth(options) 选择器 基本 #id element .class * selector1,selector2,selectorN 层级 ancestor descendant parent > child prev + next prev ~ siblings 基本 :first :...
outerHeight(options) outerWidth(options) 选择器 基本 #id element .class * selector1,selector2,selectorN 层级 ancestor descendant parent > child prev + next prev ~ siblings 基本 :first :...
outerHeight([soptions]) outerWidth([options]) 选择器 基本 #id element .class * selector1,selector2,selectorN 层级 ancestor descendant parent > child prev + next prev ~ siblings 基本 :...
在js中,存在着N多的关于高度和宽度的属性,比如:clientHeight、offsetHeight、scrollHeight、availHeight、scrollLeft、scrollTop、style.height、innerHeight、outerHeight、scree.height等等……这么多,傻傻分...