资源描述
单击此处编辑母版标题样式,单击此处编辑母版文本样式,第二级,第三级,第四级,第五级,2010/1/19,#,WEB,重构,渔隐, Taobao UED,了解,WEB,重构前需要知道的一些内容,table,The HTML table model allows authors to arrange data - text, preformatted text, images, links, forms, form fields, other tables, etc. - into rows and columns of cells.,W3C :,整理数据很方便,Table,布局,为何不建议用,table,布局?,Tables should not be used purely as a means to layout document content as this may present problems when rendering to non-visual media.,To minimize these problems, authors should use,style sheets,to control layout rather than tables.,W3C,:,是表格而非栅格,1.,不够语义,2.,维护性差,3.,不利于搜索引擎优化,4.,代码臃肿,5.,可访问性差,请不要排斥,table,Table,没有错,错的是拿,table,做布局的人,Div,和,Span,The,DIV,and,SPAN,elements, in conjunction with the,id,and,class,attributes, offer a generic mechanism for adding structure to documents. These elements define content to be inline (,SPAN,) or block-level (,DIV,) but impose no other presentational idioms on the content. Thus, authors may use these elements in conjunction with,style sheets, the,lang,attribute, etc., to tailor HTML to their own needs and tastes.,标签(结构),语义,表现(样式),div,节元素,块容器,独立一行,span,节元素,内联容器,无具体表现,table,表格,很复杂,p,段落,上下两端有边距,a,超链接,蓝色、下划线,strong,强调文本,粗体,em,强调文本,斜体,每个,html,标签都有其特有含义,WEB,重构:还标签本意,结构、表现、行为相分离,在拿到设计稿时,首先应该考虑的不是表现,而是结构,标题,强调,列表,表格,表单,段落,标题,小标题,内容,标题,表格,标题,还原语义,从代码上理解网页,基本,HTML,结构,1.Html,版本信息,文档类型,(doctype),2.Html,元素,3.,文档头,head,标签,4.,文档内容,body,标签,Doctype,Html,head,body,顺序固定且唯一,Doctype,很不起眼,但很重要,好的结构是一切的基础,文档标题,标题,小标题,内容,标题,表格,标题,分离表现,标题,to,h3,border:1px dashed #f00;,标题,分离脚本,hello world,to,hello world,document.getElementById(someid).onclick = function(),alert(hello world);,文档标题,h3color:#f00,标题,小标题,内容,标题,表格,标题, document.getElementById(someid).onclick=function(),Some coding,将表现和脚本分离到外部文件,文档标题,标题,小标题,内容,标题,表格,标题,兼容性调整,前端开发赖以生存的基本技能,淘宝网用户浏览器分布图,,19,日摘自哈勃系统,淘宝网用户屏幕分辨率分布图,,19,日摘自哈勃系统,从浏览器趋势可以看出,,IE6,虽逐步消亡,却依旧强势,为用户而设计是设计师和前端开发共同的目标,路漫漫其修远兮,THX!,
展开阅读全文