css书写技巧CSS技巧教程简介.doc
1、css书写技巧CSS技巧教程简介css 书写技巧 CSS 技巧教程简介nettuts带来的5个css书写技巧,简单翻译一下它的中心思想。1. CSS Reset/重置你也许需要先了解什么是css重置。然后怎么样写css重置呢。你可以copy Eric Meyer Reset, YUI Reset或其它css reset, 但你接下来应该根据你的项目改成你自己的reset.不要使用* margin: 0; padding: 0; 。我个人很爱用,原作者提到使用这句并不适用一些元素比如单选按钮。不过俺博客里面也没有单选按钮,如果有,又重新给单选按钮重设就好了嘛。2. 按字母顺序来排列css不按字母
2、顺序排的div#header h1 z-index: 101;color: #000;position: relative;line-height: 24px;margin-right: 48px;border-bottom: 1px solid #dedede;font-size: 18px;按字母顺序排的div#header h1 border-bottom: 1px solid #dedede;color: #000;font-size: 18px;line-height: 24px;margin-right: 48px;position: relative;z-index: 101;理由是这样可以更好的找到某个属性。个人觉得还好,差别也不是太大。不过也许会适合你。3. 更好的组织css结构使用css注释来分给css分组,这样结构明了,也有利于协同设计。/*Reset*/xxxxxxxxxxxxxxxxxxxxxx/*layouts*/xxxxxxxxxxxxxxxxxxxxxx4. 保持一致性不要无意义的去讨论到底一个选择器的所有属性写在一行,还是每个属性写一行比较好。你自己觉得ok就好。iv#header float: left; width: 100%; div#header div.column border-right: 1px
《css书写技巧CSS技巧教程简介.doc》由会员分享,可在线阅读,更多相关《css书写技巧CSS技巧教程简介.doc(4页范文模板文档)》请在优智文库上查找。