html5width与height大小,HTML5 各种height/width区别

CSS

语言:

CSSSCSS

确定

/* you can experiment with these */

/* try auto */

/* try auto, hidden, scroll, visible */

/* leave these alone */

html {

font-family: Arial, sans-serif;

overflow: hidden;

}

#content,

#overlay,

#clone {

width: 180px;

height: 180px;

padding: 35px 120px 60px 90px;

border: 10px solid cyan;

border-right-width: 25px;

border-bottom-width: 20px;

border-left-width: 15px;

background: #ffe;

overflow: auto;

margin-top: 105px;

margin-left: 105px;

text-align: justify;

}

#content,

#clone {

font-size: 12px;

}

#clone {

position: absolute;

top: 105px;

left: 105px;

margin: 0;

opacity: .2;

pointer-events: none;

border-color: transparent;

background: transparent;

overflow: visible;

width: 180px;

}

.nested {

width: 400px;

background: #eee;

}

#overlay {

position: absolute;

background: transparent;

left: 0;

top: 0;

overflow: visible;

height: 0;

width: 0;

padding: 0;

border-color: transparent;

}

#overlay,

#overlay * {

pointer-events: none;

}

#overlay div {

position: absolute;

width: 20px;

height: 20px;

overflow: visible;

}

#overlay div[id^="css"] {

color: #00c;

background: #def;

top: -35px;

left: -40px;

}

#overlay div[id^="client"] {

color: #c00;

background: #fcc;

top: -60px;

left: -65px;

}

#overlay div[id^="scroll"] {

color: #080;

background: #cfc;

top: -85px;

left: -90px;

}

#overlay div[id^="offset"] {

background: #ccc;

top: -110px;

left: -115px;

}

#overlay div[id^="padding"] {

background: gold;

color: saddlebrown;

}

#overlay div:before,

#overlay div:after {

position: absolute;

display: block;

z-index: 1;

height: 10000px;

width: 10000px;

}

#overlay div:before {

content: attr(id);

}

#overlay div:after {

content: "";

}

#overlay div[id$="Width"]:before {

border-left: 1px dashed;

}

#overlay div[id$="Width"]:before,

#overlay div#paddingRight:before,

#overlay div#paddingLeft:before {

width: 100%;

text-align: center;

}

#overlay div[id$="Width"]:after,

#overlay div#paddingRight:after {

border-right: 1px dashed;

right: 0;

}

#overlay div#paddingRight:after {

top: -25px;

}

#overlay div[id$="Height"]:before {

border-top: 1px dashed;

}

#overlay div[id$="Height"]:after,

#overlay div#paddingBottom:after,

#overlay div#paddingTop:after {

border-bottom: 1px dashed;

bottom: 0;

}

#overlay div#paddingTop:after {

left: -420px;

opacity: 0;

bottom: -1px;

}

#overlay div#paddingTop.scrolled:after {

opacity: 1;

}

#overlay div#paddingBottom:after {

left: -30px;

}

#overlay div#cssWidth {

left: 90px;

width: 180px;

}

#overlay div#scrollWidth,

#overlay div#clientWidth {

left: 0;

}

#overlay div#offsetWidth {

left: -15px;

}

#overlay div#cssHeight {

top: 35px;

height: 180px;

text-indent: -2em;

}

#overlay div#scrollHeight,

#overlay div#clientHeight {

top: 0;

text-indent: -1.5em;

}

#overlay div#offsetHeight {

top: -10px;

}

#overlay div#paddingTop {

top: 0;

height: 35px;

}

#overlay div#paddingBottom {

top: 215px;

height: 60px;

}

#overlay div#paddingTop,

#overlay div#paddingBottom {

margin-left: 5px;

left: 415px;

}

#overlay div#paddingLeft {

left: 0;

width: 90px;

}

#overlay div#paddingRight {

left: 270px;

width: 120px;

}

#overlay div#paddingLeft,

#overlay div#paddingRight {

margin-top: 5px;

top: 295px;

}

#overlay div#cssHeight {

line-height: 90px;

}

#overlay div#clientHeight {

line-height: 250px;

}

#overlay div#scrollHeight,

#overlay div#paddingTop {

line-height: 35px;

}

#overlay div#paddingBottom {

line-height: 60px;

}

#overlay div#offsetHeight {

height: 305px;

line-height: 125px;

}

#overlay div#offsetWidth {

width: 430px;

}

#overlay:after {

content: "Border";

position: absolute;

top: 295px;

left: 415px;

color: #0dd;

}

* {

-webkit-transition: opacity 1s ease;

transition: opacity 1s ease;

}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值