css属性编写顺序: 影响文档流的属性(比如:display, position, float, clear, visibility, table-layout等) 自身盒模型的属性(比如:width, height, margin, padding, border等) 排版相关属性(比如:font, line-height, text-align, text-indent, vertical-align等等) 装饰性属性(比如:color, background, opacity, curso…
From AmazeUI:http://amazeui.org/getting-started/html-css-guide HTML 属性顺序 HTML 属性应当按照以下给出的顺序依次排列,确保代码的易读性. class id, name data-* src, for, type, href title, alt aria-*, role Class 用于标识高度可复用组件,因此应该排在首位.id 用于标识具体组件,排在第二位. 布尔值属性 HTML5 规范中 disabled.checke…
传说中的Mozilla推荐 /* mozilla.org Base Styles * maintained by fantasai */ /* Suggested order: * display * list-style * position * float * clear * width * height * margin * padding * border * background * color * font * text-decoration * text-align * verti…
/* mozilla.org Base Styles * maintained by fantasai */ /* Suggested order: * display * list-style * position * float * clear * width * height * margin * padding * border * background * color * font * text-decoration * text-align * vertical-align * wh…
css属性顺序是css良好编码风格的一部分,有助于提高代码可读性,便于发现代码问题,有利于团队合作.(依次排后) example { /*显示属性*/ display: ; visibility: ; float: ; clear: ; /*定位属性*/ position: ; top: ; right: ; bottom: ; left: ; z-index: ; /*盒模型属性*/ width: ; min-width: ; max-width: ; height: ; min-height…
1. 属性写在一行内,属性之间.属性名和值之间以及属性与“{}”之间须有空格,例如:.class { width: 400px; height: 300px; }     2. 属性的书写顺序:         2.1. 按照元素模型由外及内,由整体到细节书写,大致分为五组:             位置:position,left,right,float             盒模型属性:display,margin,padding,width,height             边框与背…
我们直接从例子出发 @font-face { font-family: 'icomoon'; src: url('fonts/icomoon.eot?speta9'); src: url('fonts/icomoon.eot?speta9#iefix') format('embedded-opentype'), url('fonts/icomoon.ttf?speta9') format('truetype'), url('fonts/icomoon.woff?speta9') format('…
前言 对于css文件而言,选择器的写法有它的讲究,如—— 1> 不要用ID选择器 2> 不要用通配符*选择器 3> 选择器的层级 ...... 对于属性值的写法也有他的讲究,如—— 1> 复合属性,如font.background.margin.padding等 2> 颜色.单位.hack.css3属性等 ...... 大家往往忽略一点,便是属性的书写顺序. 来自http://mdo.github.io/code-guide/,它所提倡的css属性顺序如下—— 1> P…
JS 和 a href 在href里面注意分号结尾, 引号闭合 <a href="javascript:;">空链接</a> <a href="javascript:alert('a');">弹出</a> 一般不妨代码, 一般让它空着. 空着也可以用井号'#', 但不是很好. className <style> #div1 {width:100px; height:100px; border:1px sol…