摘要: 1、为什么要优化页面?提升网页响应速度;对搜说引擎、屏幕阅读器友好;提高可读性、可维护性等。2、如何优化?减少请求;减少文件大小;页面性能;可读性可维护性等。(1)减少请求 图片合并(合并小图标);减少CSS文件请求,可以将多个CSS文件合并为一个,少量CSS样式采用内联,避免import方式引入... 阅读全文
posted @ 2015-08-18 11:37 yxz_turing 阅读(155) 评论(0) 推荐(0) 编辑
摘要: 方案1:PositionCSS代码: 1 html,body,.parent{ 2 height: 100%; 3 overflow: hidden; 4 } 5 .top{ 6 position: absolute; 7 height: 100px; 8 ... 阅读全文
posted @ 2015-08-18 11:04 yxz_turing 阅读(214) 评论(0) 推荐(0) 编辑
摘要: 1、定宽与自适应布局方案1:float + marginCSS代码:1 .left{2 float: left;3 width: 100px;4 background-color: red;5 }6 .right{7 background-color: green;8... 阅读全文
posted @ 2015-08-17 18:45 yxz_turing 阅读(270) 评论(0) 推荐(0) 编辑
摘要: 1、水平居中布局(父容器和子容器宽度都不是固定的)方案1:利用inline-block 和 text-align,设置父容器的text-align="center",即父容器内的inline元素居中显示,再把子容器display设置成inline-block即可。CSS代码:1 .parent{2 ... 阅读全文
posted @ 2015-08-17 17:30 yxz_turing 阅读(293) 评论(0) 推荐(0) 编辑
摘要: JS为弱类型语言,所以类型识别对JS而言尤为重要,JS中常用的类型识别方法有4种:typeof、Object.prototype.toString、constructor和instanceof。(1)typeof可以识别标准类型(Null除外),不能识别具体的对象类型(Function除外),举例如... 阅读全文
posted @ 2015-08-17 12:10 yxz_turing 阅读(498) 评论(0) 推荐(0) 编辑
摘要: 话不多说,直接上例子:1、程序的运行结果为:100 10 1001 var a = 10;2 function test(){3 a = 100;4 console.log(a);5 console.log(this.a);6 var a;7 console.... 阅读全文
posted @ 2015-08-17 10:34 yxz_turing 阅读(65840) 评论(3) 推荐(8) 编辑