这些都是新内容,觉得好陌生,要多练才行 1、background-origin 背景原点,必需保证背景是background-repeat为no-repeat。 如:html:<div class=”img”></div> css: .img{width=”300px”; height=”250”; ...
分类:
Web程序 时间:
2016-08-15 14:22:23
阅读次数:
190
function css(target,styles){ for (var k in styles){ target.style[k]=styles[k]; } } 示例: var div = document.querySelector("div"); css(div,{width:300+"px ...
分类:
Web程序 时间:
2016-08-15 12:50:02
阅读次数:
133
CSS中目前只有calc()能做运算,但是在Sass中,可以做各种数学运算。加法.box{
width: 20px + 8in;
}编译出来的CSS:.box {
width: 788px;
}1in = 96px;当em,rem等相对当前字体,于px在一起不能运算,会报错,如:.box{
width: 20px + 8em;
}不过如果其中一个不同单位,那么会以另一个带单位的为...
分类:
其他好文 时间:
2016-08-15 11:36:40
阅读次数:
242
Design a Snake game that is played on a device with screen size = width x height. Play the game online if you are not familiar with the game. The snak ...
分类:
其他好文 时间:
2016-08-15 10:11:54
阅读次数:
209
跟DOM一样,BOM其实也是由很多的API组成。 不过对于BOM来说,最痛苦的不是不记得API,而是明明记得这个这个API,却没有考虑到它的兼容性。 之前的文章中讲到了offset系列的属性,他的宽高是由border,padding和width组成的。而它的offsetLeft和offsetTop则 ...
分类:
其他好文 时间:
2016-08-15 01:24:41
阅读次数:
128
特效"三大家族": offset 偏移 scroll 滚动 client 可视区 offset家族: offsetWidth和style.width的区别: style.width只能获取行内式,offsetWidth不管行内还是内嵌都能获取 style.width是字符串,带px,offsetWi ...
分类:
其他好文 时间:
2016-08-15 00:12:17
阅读次数:
195
.triangle{ width: 0;height: 0; border-left: 60px solid transparent; border-right: 60px solid transparent; border-top: 120px solid red; } ...
分类:
Web程序 时间:
2016-08-15 00:05:13
阅读次数:
192
简介:设置各种框的高度宽度,使之成为设定尺寸,收缩适应到内容或拉伸到最大尺寸的框。 设定尺寸:手动设置元素的高度和宽度; 收缩适应:将元素的宽度或高度缩小为其内容尺寸; 拉伸:将元素的宽度和高度拉伸到容器的各边; 1、 宽度:width:auto 可以横向收缩以下类型的框:行内型、行内块级型、浮动型 ...
分类:
其他好文 时间:
2016-08-14 20:38:06
阅读次数:
131
*在320分辨率下*/ #home{ a{ .box(); -webkit-box-pack:center; -webkit-box-align:center; margin-top:10px; img{ width:300px; height:auto; } } }/*在680-900分辨率下 i ...
分类:
其他好文 时间:
2016-08-14 20:34:33
阅读次数:
147
border-radius 圆角的方块: 实心上半圆: 方法:把高度(height)设为宽度(width)的一半,并且只设置左上角和右上角的半径与元素的高度一致(也可以大于高度)。 实心圆: 方法:把宽度(width)与高度(height)值设置为一致(也就是正方形),并且四个圆角值都设置为它们值的 ...
分类:
Web程序 时间:
2016-08-14 17:53:47
阅读次数:
230