上一页 1 2 3 4 5 6 7 8 ··· 10 下一页
摘要: normalize.css是一个保证跨浏览器对html渲染一致性的css文件。它针对html5,可作为传统css reset的替代。normalize.css 取得广泛应用: twitter bootstrap, html5 boilerplate, Rdio, css tricks等很多框架。网站都使用到它。概述 normalize.css是一个css reset方案,它的核心理念是:保留有用的默认浏览器样式,而不是擦除针对广泛的html元素样式进行规格化修复bug和常见的浏览器样式上的不一致通过适当调节提高可用性充分使用注释和文档解释代码 normalize.css支持众多浏览器(包括.. 阅读全文
posted @ 2013-11-29 15:55 我的百科全书 阅读(807) 评论(0) 推荐(0) 编辑
摘要: Node.textContent: 对节点及其后代节点文本内容的读写1 var text = element.textContent;2 element.textContent = "this is some text"如果元素是document、document type或者notation,textContent返回null,如需要获取文档所有text和CDATA数据,使用:document.documentElement.textContent如果元素是CDATA、注释、处理指令或者文本节点,textContent返回其内部文本对于其他类型的节点,textConten 阅读全文
posted @ 2013-11-29 15:43 我的百科全书 阅读(520) 评论(0) 推荐(0) 编辑
摘要: 设置竖直居中元素的父元素display为table-cell然后vertical-align: middle 1 2 center 3 4 5 http://jsfiddle.net/4PJUr/这里是demo, http://www.w3.org/Style/Examples/007/center.en.html#vertical这里是出处设置需要居中元素position为absolute, 其需要居中的元素position为非static。需要居中的元素top, bottom为0, margin为auto。并且显式设置高度 1 2 here is center 3 4... 阅读全文
posted @ 2013-11-28 08:13 我的百科全书 阅读(245) 评论(0) 推荐(0) 编辑
摘要: 如果display设为none,不产生框,所以float和position的值会被忽略否则,如果position设置为absolute或者fixed。float将会忽略(computed value将为none),对应的display将如下表进行计算。否则,如果float不为none,那么框将浮动display将根据下面表格进行计算否则,如果元素是根元素,display将根据下表进行计算。例外:在css2.1中list-item会获得block或者list-item没有定义否则,在其他情况下,display将依据设置值进行计算 阅读全文
posted @ 2013-11-27 20:34 我的百科全书 阅读(155) 评论(0) 推荐(0) 编辑
摘要: 下面两段代码输出什么:1 var foo = 1;2 function bar() {3 if (!foo) {4 var foo = 10;5 } // end if6 alert(foo);7 } // end bar()8 9 bar(); // 10你可以再这里查看结果:http://jsfiddle.net/pMfNk/1 var a = 1;2 function b() {3 a = 10;4 return;5 function a() {}6 } // end b()7 8 b();9 alert(a); // 1可以再这里查看结果:http:/... 阅读全文
posted @ 2013-11-27 11:22 我的百科全书 阅读(259) 评论(0) 推荐(1) 编辑
摘要: 原型对象与prototype属性的区别每个对象都有原型对象只有函数才有prototype属性,当函数作为构造函数调用时,其prototype属性作为创建的对象的原型对象实现继承的常用方法:1 类继承:extend函数,将父类从子类构造函数中解耦,父类构造函数只要能恰当处理适当参数即可,通过superclass可以在需要重新定义父类方法是访问父类中的实现方法 1 function extend (subClass, superClass) { 2 var F = function () {}; 3 F.prototype = superClass.prototype; 4 subC... 阅读全文
posted @ 2013-11-25 21:55 我的百科全书 阅读(178) 评论(0) 推荐(0) 编辑
摘要: ajax在使用中会受到同源策略限制,当目标url的协议,域名,端口之一与脚本所在文档不一致时就不能访问并获取数据。解决这一问题的方案有很多:服务器端代理跨域资源共享通过含有src属性的元素请求资源:,40 41 相比跨源资源共享和服务器端代理jsonp相对简单,也存在一定缺点:script标签的局限性使得只支持GET方法缺少对传输的状态控制 阅读全文
posted @ 2013-11-20 17:45 我的百科全书 阅读(293) 评论(0) 推荐(0) 编辑
摘要: 1 #wrapper { 2 float: left; 3 margin-right: 400px; 4 } 5 #navigation { 6 width: 200px; 7 float: left; 8 margin-left: -400px; 9 }10 #extra {11 width: 200px;12 float: left;13 margin-left: -200px;14 }15 #footer {16 clear: both;17 } 1 #wrapper { 2 float: right; 3 margin-right: 400... 阅读全文
posted @ 2013-11-19 19:44 我的百科全书 阅读(124) 评论(0) 推荐(0) 编辑
摘要: 1 #wrapper { 2 margin: 0 200px; 3 float: left; 4 } 5 #navigation { 6 width: 200px; 7 float: left; 8 margin-left: -200px; 9 }10 #extra {11 width: 200px;12 float: left;13 margin-left: -100%;14 }15 16 #footer {17 clear: both;18 } 1 #wrapper { 2 margin: 0 200px; 3 float: right; 4 ... 阅读全文
posted @ 2013-11-19 19:35 我的百科全书 阅读(141) 评论(0) 推荐(0) 编辑
摘要: 1. 1 #wrapper { 2 float: left; 3 } 4 #content { 5 margin: 0 200px; 6 } 7 #navigation { 8 width: 200px; 9 float: left;10 margin-left: -100%;11 }12 #extra {13 width: 200px;14 float: left;15 margin-left: -200px;16 }17 #footer {18 clear: both;19 }2 1 #wrapper { 2 float: right; 3 } 4 ... 阅读全文
posted @ 2013-11-19 19:24 我的百科全书 阅读(139) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 ··· 10 下一页