<!--
/*<! [CDATA[*/
body { color: #000; background-color: #fff; margin: 0px 10%; min-width: 720px; font-family: Verdana, sans-serif;
counter-reset: chapter section subsection subsubsection paragraph lchapter lsection lsubsection lsubsubsection lparagraph}
div.footnote { border-left: 1px solid #000; margin-left: 0em; clear: both }
div.ftext { position: relative; margin-left: 50px }
div.fnumber { float: left; width: 40px; padding: 0em; margin-left: 0.5em; margin-top: 0em }
div.fnumber a { margin: 0px; padding: 0px }
div.ctext { position: relative; margin-left: 100px }
div.cnumber { float: left; width: 90px; padding: 0em; margin-left: 0.5em; margin-top: 0em }
div.cnumber a { margin: 0px; padding: 0px }
div.tip { border: 2px solid #0d0; margin: 0.5em 2em 1em 2em; padding: 0em 1em }
div.warning, div.caution, div.danger, div.error { border: 2px solid #f00; margin: 0.5em 2em 1em 2em; padding: 0em 1em }
div.note, div.hint, div.important { border: 2px solid #000; margin: 0.5em 2em 1em 2em; padding: 0em 1em }
div.figure { display: block; padding: 1em; width: 400px; clear: both}
div.topic { margin: 2em }
div.vstsidebar, div.sidebar { border: 2px solid #aaa; color: #000; background-color: #ffffee; float: right; width: 40%; margin-left: 1em; margin-right: -1em; padding: 1em }
span.strike { text-decoration: line-through }
span.big { font-size: large }
span.small { font-size: small }
span.title { font-style: italic }
span.notetitle { font-size: large; font-weight: 900; font-family: Verdana, sans-serif }
p.toc { font-size: large; font-weight: 900 }
p.notesubtitle { font-weight: 900; font-family: Verdana, sans-serif }
p.attribution { font-style: italic; margin-left: 8em; text-indent: -1.4em }
.vstright { float: right; margin: 1em }
.vstleft { float: left; margin: 1em }
.vstcenter { margin: 1em auto }
blockquote.pull { font-size: large }
p.rubric { font-size: large; margin-left: 2em }
dd.normal { margin-bottom: 0.5em }
dt.option { float: left; margin: 0em 0em 5px 2em; padding: 0px; font-family: monospace }
dd.option { padding: 0px; margin: 0em 0em 5px 10em; text-indent: 0.5em }
dd.option > p { margin: 0px }
dd.normal > p { margin: 0px }
table { border-collapse: collapse; margin: 0.5em 0em }
thead, tfoot { text-align: center; font-weight: bold }
td { border: 1px solid #000; padding: 0.25em; _top: 0%; vertical-align: top }
td blockquote p{ margin: 0px; padding: 0px}
td blockquote { margin: 0px; padding: 0px}
table.vstbless td { border: 0px solid #000; padding: 0.25em; _top: 0%; vertical-align: top }
td > p { margin: 0px }
table.field { border: 0px solid #000; margin-left: 2em; padding: 0.25em; _top: 0%; vertical-align: top }
td.fkey { font-weight: 900 }
td.fval { border: 0px solid #000; padding: 0.25em; _top: 0%; vertical-align: top }
td.fkey { font-weight: 900; border: 0px solid #000; padding: 0.25em; _top: 0%; vertical-align: top }
td.fdkey { text-align: center; font-weight: 900 }
td.fdval { text-align: center; font-style: italic }
td.fakey { text-align: center; font-weight: 900 }
td.faval { border: 0px solid #000; padding: 0.25em; _top: 0%; vertical-align: top }
hr { width: 100%; margin: 1.5em auto }
h1 { text-align: center; clear: both }
h2, h3, h4, h5, h6 { text-align: left; margin-top: 1em; clear: both }
h2 { counter-reset: section subsection subsubsection paragraph }
h3 { counter-reset: subsection subsubsection paragraph }
h4 { counter-reset: subsubsection paragraph }
h5 { counter-reset: paragraph }
h1 a { color: #000; background-color: transparent }
h2 a { color: #000; background-color: transparent }
h3 a { color: #000; background-color: transparent }
h4 a { color: #000; background-color: transparent }
h5 a { color: #000; background-color: transparent }
h6 a { color: #000; background-color: transparent }
p.subh1 { text-align: center; font-size: 120%; font-variant: small-caps }
p.subh2, p.subh3, p.subh4, p.subh5, p.subh6 { text-align: left; font-size: 120%; font-variant: small-caps }
h2:before { content: counter(chapter)" "; counter-increment: chapter }
h3:before { content: counter(chapter)"."counter(section)" "; counter-increment: section }
h4:before { content: counter(chapter)"."counter(section)"."counter(subsection)" "; counter-increment: subsection }
h5:before { content: counter(chapter)"."counter(section)"."counter(subsection)"."counter(subsubsection)" "; counter-increment: subsubsection }
h6:before { content: counter(chapter)"."counter(section)"."counter(subsection)"."counter(subsubsection)"."counter(paragraph)" "; counter-increment: paragraph}
li.h1 { margin-left: 0em }
li.h2 { margin-left: 1em; counter-reset: lsection lsubsection lsubsubsection lparagraph }
li.h3 { margin-left: 2em; counter-reset: lsubsection lsubsubsection lparagraph }
li.h4 { margin-left: 3em; counter-reset: lsubsubsection lparagraph }
li.h5 { margin-left: 4em; counter-reset: lparagraph }
li.h2:before { content: counter(lchapter)" "; counter-increment: lchapter }
li.h3:before { content: counter(lchapter)"."counter(lsection)" "; counter-increment: lsection }
li.h4:before { content: counter(lchapter)"."counter(lsection)"."counter(lsubsection)" "; counter-increment: lsubsection }
li.h5:before { content: counter(lchapter)"."counter(lsection)"."counter(lsubsection)"."counter(lsubsubsection)" "; counter-increment: lsubsubsection }
li.h6:before { content: counter(lchapter)"."counter(lsection)"."counter(lsubsection)"."counter(lsubsubsection)"."counter(lparagraph)" "; counter-increment: lparagraph}
li.h6 { margin-left: 5em }
ol, ul { margin-bottom: 0.5em; margin-top: 0.5em }
ol.loweralpha { list-style-type: lower-alpha }
ol.upperalpha { list-style-type: upper-alpha }
ol.lowerroman { list-style-type: lower-roman }
ol.upperroman { list-style-type: upper-roman }
ol.decimal { list-style-type: decimal }
ul.square { list-style-type: square }
ul.circle { list-style-type: circle }
ul.disc { list-style-type: disc }
li > p { margin: 0em }
img { border: 1px solid #000; padding: 0em; display: block; margin: 1em auto }
img.inline { border: 1px solid #000; padding: 0em; margin: 0em; display: inline }
pre { color: #000; background-color: #eee; margin-left: 2em; clear: both; overflow: auto }
div.unknown { font-family: monospace; color: #000; background-color: #fff; margin: 1em; padding: 1em; clear: both; border: 3px solid red}
pre.quoted { color: #000; background-color: #eee; margin-left: 0em; clear: both; overflow: auto }
pre.rawlatex { color: #000; background-color: #ddd; border: 1px solid #000; padding: 0.1em; clear: both; overflow: auto }
pre.address { font-family: Verdana, sans-serif; display: inline; margin: 0px; color: #000; background-color: #fff; overflow: auto }
span.target { text-decoration: underline }
div.vstfooter hr { width: 100%; margin: 0px }
div.vstfooter p { margin: 0px }
/*]]>*/
-->
<!--
/*<! [CDATA[*/
.tohtml-javascript moring { color: #808080; background-color: #ffffff; font-family: monospace; }
.tohtml-javascript moring .Statement { color: #ffff00; }
.tohtml-javascript moring .Constant { color: #ff6060; }
.tohtml-javascript moring .Comment { color: #8080ff; }
.tohtml-javascript moring .Identifier { color: #00ffff; }
/*]]-->
最近在读<<JavaScript Dom编程艺术>>(http://www.douban.com/subject/1921890/)一书,总结了一部分有价值的设计思想。
网页可以由以下三个层次构成一个共同体:
结构层:
网页的结构层是由HTML或XHTML之类的标记语言负责创建。标签对网页内容的语义含义做出了描述,但这些标签不包含任何关于如何有关内容的信息。
表示层:
网页的表示层由CSS负责创建。CSS对“如何显示有关内容”的问题做出了回答。
行为层:
网页的行为层负责回答“内容应该如何对事件 做出反应”这一问题,这一层主要通过JavaScript和DOM技术来实现。
设计一个网站或者WEB应用程序 ,需要按照结构、表示、行为三个层次对内容进行分离。这意味着:
-
使用(X)HTML去搭建文档的结构。
-
使用CSS去设置文档的呈现效果。
-
使用DOM脚本去实现文档的行为。
这本书还介绍每一个层次的分离方法:结构层和行为层的分离是比较简单,CSS本身提供了一系列机制来对HTML内容添加显示样式。本书作者重点介绍了结构层(HTML)和行为层(JS脚本)分离的方法。
如对于如下的HTML文件 test.html:
<body>
<div id="imagegallery">
<a href="www.a.com"/>
<b href="www.b.com"/>
<b href="www.b.com"/>
</div>
</body>
</html>
可以将网页中的动作分离到以下的JS文件test.js:
functionprepareGallery(){
vargallery = document.getElementById("imagegallery");
varlinks = gallery.getElementsByTagName("a");
for(vari = 0; i < links.length; i++){
links[i].onclick = function(){
returnshowPic(this);
}
}
}
functionaddLoadEvent(func){
varoldonLoad = window.onload;
if(typeofwindow.onload != 'function'){
window.onload = func;
}else{
window.onload = function(){
oldonload();
func();
}
}
}
addLoadEvent(prepareGallery);
分享到:
相关推荐
SSL加密技术学习总结
进行Web前台开发,需要掌握的技术总结,学习资料和输出总结
web前端学习总结1.docx
WEB表单设计学习总结.docx
学习 Web 技术:HTML,CSS,JavaScript学习 Web 技术:HTML,CSS,JavaScript 学习 Web 技术:HTML,CSS,JavaScript学习 Web 技术:HTML,CSS,JavaScript 学习 Web 技术:HTML,CSS,JavaScript学习 Web 技术:...
关于Web技术的课程资源,,希望对大家有所帮助。一般对学习网页制作的同学有参考的价值
关于web技术学习的一点补充
移动web学习总结 .docx
此文件为作者学习Web前端技术时记录的常用知识点,语句,方法
Webservers学习总结.pdf
Web前端开发技术学习方式探讨.pdf
嵌入式webServer初步学习总结报告,关于嵌入式WebServer简介,概念简介,系统设计以及技术分析
学习Web开发过程中的笔记,包括主要内容以及自己的理解
JAVA开发技术学习文档 SSH框架开发及WEB开发及性能优化,
包含CSS、HTML、JavaScript、PHP等的学习手册
由于Java Web开发技术大全pdf文件太大120多M,上传资源要求在20M以内,所以大家必须要把Java Web开发技术大全.z01,Java Web开发技术大全.z02,Java Web开发技术大全.z03,Java Web开发技术大全.z04,Java Web开发...
基于WEB技术的学习系统研究与设计毕业论文
java技术学习路线图,涵盖了java SE基础知识的学习到java Web技术的开发,jee的开发,从基础到java的JAVA EE顶峰,所要学的知识,都在这图上。
Springboot web 技术栈高清PDF学习文档,入门到进阶再到实战的教程都有